crmf.h
来自「支持SSL v2/v3, TLS, PKCS #5, PKCS #7, PKCS」· C头文件 代码 · 共 1,780 行 · 第 1/5 页
H
1,780 行
* inCertReq * The Cert request to operate on. * destSubjectUID * A pointer to where the library can store a copy of the request's * cert template destIssuerUID. * * NOTES: * destSubjectUID is a bit string and will be returned in a SECItem as * a bit string. Meaning the len field contains the number of valid bits as * opposed to the number of bytes allocated. * * RETURN: * If the CertTemplate has an issuerUID, the function returns SECSuccess and * places a copy of the issuerUID in *destIssuerUID. * * If there is no issuerUID, the function returns SECSuccess and the value * *destIssuerUID is unchanged. */extern SECStatus CRMF_GetCertTemplateSubjectUID(CRMFCertRequest *inCertReq, SECItem *destSubjectUID);/* * FUNCTION: CRMF_CertRequestGetNumberOfExtensions * INPUTS: * inCertReq * The cert request to operate on. * RETURN: * Returns the number of extensions contained by the Cert Request. */extern int CRMF_CertRequestGetNumberOfExtensions(CRMFCertRequest *inCertReq);/* * FUNCTION: CRMF_CertRequestGetExtensionAtIndex * INPUTS: * inCertReq * The Certificate request to operate on. * index * The index of the extension array whihc the user wants to access. * NOTES: * This function retrieves the extension at the index corresponding to the * parameter "index" indicates. Indexing is done like a C array. * (0 ... numElements-1) * * Call CRMF_DestroyCertExtension when done using the return value. * * RETURN: * A pointer to a copy of the extension at the desired index. A NULL * return value indicates an invalid index or an error while copying * the extension. */extern CRMFCertExtension * CRMF_CertRequestGetExtensionAtIndex(CRMFCertRequest *inCertReq, int index);/* * FUNCTION: CRMF_CertExtensionGetOidTag * INPUTS: * inExtension * The extension to operate on. * RETURN: * Returns the SECOidTag associated with the cert extension passed in. */extern SECOidTag CRMF_CertExtensionGetOidTag(CRMFCertExtension *inExtension);/* * FUNCTION: CRMF_CertExtensionGetIsCritical * INPUT: * inExt * The cert extension to operate on. * * RETURN: * PR_TRUE if the extension is critical. * PR_FALSE if the extension is not critical. */extern PRBool CRMF_CertExtensionGetIsCritical(CRMFCertExtension *inExt); /* * FUNCTION: CRMF_CertExtensionGetValue * INPUT: * inExtension * The extension to operate on. * NOTES: * Caller is responsible for freeing the memory associated with the return * value. Call SECITEM_FreeItem(retVal, PR_TRUE) when done using the return * value. * * RETURN: * A pointer to an item containig the value for the certificate extension. * A NULL return value indicates an error in copying the information. */extern SECItem* CRMF_CertExtensionGetValue(CRMFCertExtension *inExtension);/* * FUNCTION: CRMF_CertReqMsgGetPOPOSigningKey * INPUTS: * inCertReqMsg * The certificate request message to operate on. * destKey * A pointer to where the library can place a pointer to * a copy of the Proof Of Possession Signing Key used * by the message. * * RETURN: * Get the POPOSigningKey associated with this CRMFCertReqMsg. * If the CertReqMsg does not have a pop, the function returns * SECFailure and the value at *destKey is un-changed.. * * If the CertReqMsg does have a pop, then the CertReqMsg's * POPOSigningKey will be placed at *destKey. */extern SECStatus CRMF_CertReqMsgGetPOPOSigningKey(CRMFCertReqMsg *inCertReqMsg, CRMFPOPOSigningKey **destKey);/* * FUNCTION: CRMF_DestroyPOPOSigningKey * INPUTS: * inKey * The signing key to free. * * RETURN: * SECSuccess if freeing the memory was successful. Any other return value * indicates an error while freeing memory. */extern SECStatus CRMF_DestroyPOPOSigningKey (CRMFPOPOSigningKey *inKey);/* * FUNCTION: CRMF_POPOSigningKeyGetAlgID * INPUTS: * inSignKey * The Signing Key to operate on. * RETURN: * Return the algorithmID used by the CRMFPOPOSigningKey. User must * call SECOID_DestroyAlgorithmID(destID, PR_TRUE) when done using the * return value. */extern SECAlgorithmID* CRMF_POPOSigningKeyGetAlgID(CRMFPOPOSigningKey *inSignKey);/* * FUNCTION: CRMF_POPOSigningKeyGetSignature * INPUTS: * inSignKey * The Signing Key to operate on. * * RETURN: * Get the actual signature stored away in the CRMFPOPOSigningKey. SECItem * returned is a BIT STRING, so the len field is the number of bits as opposed * to the total number of bytes allocatd. User must call * SECITEM_FreeItem(retVal,PR_TRUE) when done using the return value. */extern SECItem* CRMF_POPOSigningKeyGetSignature(CRMFPOPOSigningKey *inSignKey);/* * FUNCTION: CRMF_POPOSigningKeyGetInput * INPUTS: * inSignKey * The Signing Key to operate on. * NOTES: * This function will return the der encoded input that was read in while * decoding. The API does not support this option when creating, so you * cannot add this field. * * RETURN: * Get the poposkInput that is part of the of the POPOSigningKey. If the * optional field is not part of the POPOSigningKey, the function returns * NULL. * * If the optional field is part of the POPOSingingKey, the function will * return a copy of the der encoded poposkInput. */extern SECItem* CRMF_POPOSigningKeyGetInput(CRMFPOPOSigningKey *inSignKey);/* * FUNCTION: CRMF_CertReqMsgGetPOPKeyEncipherment * INPUTS: * inCertReqMsg * The certificate request message to operate on. * destKey * A pointer to where the library can place a pointer to a * copy of the POPOPrivKey representing Key Encipherment * Proof of Possession. *NOTES: * This function gets the POPOPrivKey associated with this CRMFCertReqMsg * for Key Encipherment. * * RETURN: * If the CertReqMsg did not use Key Encipherment for Proof Of Possession, the * function returns SECFailure and the value at *destKey is un-changed. * * If the CertReqMsg did use Key Encipherment for ProofOfPossession, the * function returns SECSuccess and places the POPOPrivKey representing the * Key Encipherment Proof Of Possessin at *destKey. */extern SECStatus CRMF_CertReqMsgGetPOPKeyEncipherment(CRMFCertReqMsg *inCertReqMsg, CRMFPOPOPrivKey **destKey);/* * FUNCTION: CRMF_CertReqMsgGetPOPKeyAgreement * INPUTS: * inCertReqMsg * The certificate request message to operate on. * destKey * A pointer to where the library can place a pointer to a * copy of the POPOPrivKey representing Key Agreement * Proof of Possession. * NOTES: * This function gets the POPOPrivKey associated with this CRMFCertReqMsg for * Key Agreement. * * RETURN: * If the CertReqMsg used Key Agreement for Proof Of Possession, the * function returns SECSuccess and the POPOPrivKey for Key Agreement * is placed at *destKey. * * If the CertReqMsg did not use Key Agreement for Proof Of Possession, the * function return SECFailure and the value at *destKey is unchanged. */extern SECStatus CRMF_CertReqMsgGetPOPKeyAgreement(CRMFCertReqMsg *inCertReqMsg, CRMFPOPOPrivKey **destKey);/* * FUNCTION: CRMF_DestroyPOPOPrivKey * INPUTS: * inPrivKey * The POPOPrivKey to destroy. * NOTES: * Destroy a structure allocated by CRMF_GetPOPKeyEncipherment or * CRMF_GetPOPKeyAgreement. * * RETURN: * SECSuccess on successful destruction of the POPOPrivKey. * Any other return value indicates an error in freeing the * memory. */extern SECStatus CRMF_DestroyPOPOPrivKey(CRMFPOPOPrivKey *inPrivKey);/* * FUNCTION: CRMF_POPOPrivKeyGetChoice * INPUT: * inKey * The POPOPrivKey to operate on. * RETURN: * Returns which choice was used in constructing the POPPOPrivKey. Look at * the definition of CRMFPOPOPrivKeyChoice in crmft.h for the possible return * values. */extern CRMFPOPOPrivKeyChoice CRMF_POPOPrivKeyGetChoice(CRMFPOPOPrivKey *inKey);/* * FUNCTION: CRMF_POPOPrivKeyGetThisMessage * INPUTS: * inKey * The POPOPrivKey to operate on. * destString * A pointer to where the library can place a copy of the This Message * field stored in the POPOPrivKey * * RETURN: * Returns the field thisMessage from the POPOPrivKey. * If the POPOPrivKey did not use the field thisMessage, the function * returns SECFailure and the value at *destString is unchanged. * * If the POPOPrivKey did use the field thisMessage, the function returns * SECSuccess and the BIT STRING representing thisMessage is placed * at *destString. BIT STRING representation means the len field is the * number of valid bits as opposed to the total number of bytes. */extern SECStatus CRMF_POPOPrivKeyGetThisMessage(CRMFPOPOPrivKey *inKey, SECItem *destString);/* * FUNCTION: CRMF_POPOPrivKeyGetSubseqMess * INPUTS: * inKey * The POPOPrivKey to operate on. * destOpt * A pointer to where the library can place the value of the * Subsequent Message option used by POPOPrivKey. * * RETURN: * Retrieves the field subsequentMessage from the POPOPrivKey. * If the POPOPrivKey used the subsequentMessage option, the function * returns SECSuccess and places the appropriate enumerated value at * *destMessageOption. * * If the POPOPrivKey did not use the subsequenMessage option, the function * returns SECFailure and the value at *destOpt is un-changed. */extern SECStatus CRMF_POPOPrivKeyGetSubseqMess(CRMFPOPOPrivKey *inKey, CRMFSubseqMessOptions *destOpt);/* * FUNCTION: CRMF_POPOPrivKeyGetDHMAC * INPUTS: * inKey * The POPOPrivKey to operate on. * destMAC * A pointer to where the library can place a copy of the dhMAC * field of the POPOPrivKey. * * NOTES: * Returns the field dhMAC from the POPOPrivKey. The populated SECItem * is in BIT STRING format. * * RETURN: * If the POPOPrivKey used the dhMAC option, the function returns SECSuccess * and the BIT STRING for dhMAC will be placed at *destMAC. The len field in * destMAC (ie destMAC->len) will be the valid number of bits as opposed to * the number of allocated bytes. * * If the POPOPrivKey did not use the dhMAC option, the function returns * SECFailure and the value at *destMAC is unchanged. * */extern SECStatus CRMF_POPOPrivKeyGetDHMAC(CRMFPOPOPrivKey *inKey, SECItem *destMAC);/* * FUNCTION: CRMF_CertRequestGetNumControls * INPUTS: * inCertReq * The Certificate Request to operate on. * RETURN: * Returns the number of Controls registered with this CertRequest. */extern int CRMF_CertRequestGetNumControls (CRMFCertRequest *inCertReq);/* * FUNCTION: CRMF_CertRequestGetControlAtIndex * INPUTS: * inCertReq * The certificate request to operate on. * index * The index of the control the user wants a copy of. * NOTES: * Function retrieves the Control at located at index. The Controls * are numbered like a traditional C array (0 ... numElements-1) * * RETURN: * Returns a copy of the control at the index specified. This is a copy * so the user must call CRMF_DestroyControl after the return value is no * longer needed. A return value of NULL indicates an error while copying * the control or that the index was invalid. */extern CRMFControl* CRMF_CertRequestGetControlAtIndex(CRMFCertRequest *inCertReq, int index);/* * FUNCTION: CRMF_DestroyControl * INPUTS: * inControl * The Control to destroy.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?