crmf.h

来自「支持SSL v2/v3, TLS, PKCS #5, PKCS #7, PKCS」· C头文件 代码 · 共 1,780 行 · 第 1/5 页

H
1,780
字号
 * NOTES: * Destroy a CRMFControl allocated by CRMF_GetControlAtIndex. * * RETURN: * SECSuccess if freeing the memory was successful.  Any other return * value indicates an error while freeing the memory. */extern SECStatus CRMF_DestroyControl(CRMFControl *inControl);/* * FUNCTION: CRMF_ControlGetControlType * INPUTS: *    inControl *        The control to operate on. * NOTES: * The function returns an enumertion which indicates the type of control * 'inControl'. * * RETURN: * Look in crmft.h at the definition of the enumerated type CRMFControlType * for the possible return values. */extern CRMFControlType CRMF_ControlGetControlType(CRMFControl *inControl);/* * FUNCTION: CRMF_ControlGetRegTokenControlValue * INPUTS: *    inControl *        The Control to operate on. * NOTES: * The user must call SECITEM_FreeItem passing in the return value * after the returnvalue is no longer needed. * RETURN: * Return the value for a Registration Token Control. * The SECItem returned should be in UTF8 format.  A NULL * return value indicates there was no Registration Control associated * with the Control. * (This library will not verify format.  It assumes the client properly  * formatted the strings when adding it or the message decoded was properly  * formatted.  The library will just give back the bytes it was given.) */extern SECItem* CRMF_ControlGetRegTokenControlValue(CRMFControl *inControl);/* * FUNCTION: CRMF_ControlGetAuthenticatorControlValue * INPUTS: *    inControl *        The Control to operate on. * NOTES: * The user must call SECITEM_FreeItem passing in the return value * after the returnvalue is no longer needed. * * RETURN: * Return the value for the Authenticator Control. * The SECItem returned should be in UTF8 format.  A NULL * return value indicates there was no Authenticator Control associated * with the CRMFControl.. * (This library will not verify format.  It assumes the client properly  * formatted the strings when adding it or the message decoded was properly  * formatted.  The library will just give back the bytes it was given.) */extern SECItem* CRMF_ControlGetAuthicatorControlValue(CRMFControl *inControl);/* * FUNCTION: CRMF_ControlGetPKIArchiveOptions * INPUTS:inControl *    The Control tooperate on. * NOTES: * This function returns a copy of the PKIArchiveOptions.  The user must call * the function CRMF_DestroyPKIArchiveOptions when the return value is no * longer needed. * * RETURN: * Get the PKIArchiveOptions associated with the Control.  A return * value of NULL indicates the Control was not a PKIArchiveOptions  * Control. */extern CRMFPKIArchiveOptions*        CRMF_ControlGetPKIArchiveOptions(CRMFControl *inControl);  /* * FUNCTION: CMRF_DestroyPKIArchiveOptions * INPUTS: *    inOptions *        The ArchiveOptions to destroy. * NOTE: * Destroy the CRMFPKIArchiveOptions structure. * * RETURN: * SECSuccess if successful in freeing all the memory associated with  * the PKIArchiveOptions.  Any other return value indicates an error while * freeing the PKIArchiveOptions. */extern SECStatus        CRMF_DestroyPKIArchiveOptions(CRMFPKIArchiveOptions *inOptions);/* * FUNCTION: CRMF_PKIArchiveOptionsGetOptionType * INPUTS: *    inOptions *        The PKIArchiveOptions to operate on. * RETURN: * Returns the choice used for the PKIArchiveOptions.  Look at the definition * of CRMFPKIArchiveOptionsType in crmft.h for possible return values. */extern CRMFPKIArchiveOptionsType       CRMF_PKIArchiveOptionsGetOptionType(CRMFPKIArchiveOptions *inOptions);/* * FUNCTION: CRMF_PKIArchiveOptionsGetEncryptedPrivKey * INPUTS: *    inOpts *        The PKIArchiveOptions to operate on. *  * NOTES: * The user must call CRMF_DestroyEncryptedKey when done using this return * value. * * RETURN: * Get the encryptedPrivKey field of the PKIArchiveOptions structure. * A return value of NULL indicates that encryptedPrivKey was not used as * the choice for this PKIArchiveOptions. */extern CRMFEncryptedKey*      CRMF_PKIArchiveOptionsGetEncryptedPrivKey(CRMFPKIArchiveOptions *inOpts);/* * FUNCTION: CRMF_EncryptedKeyGetChoice * INPUTS: *    inEncrKey *        The EncryptedKey to operate on. * * NOTES: * Get the choice used for representing the EncryptedKey. * * RETURN: * Returns the Choice used in representing the EncryptedKey.  Look in  * crmft.h at the definition of CRMFEncryptedKeyChoice for possible return * values. */extern CRMFEncryptedKeyChoice        CRMF_EncryptedKeyGetChoice(CRMFEncryptedKey *inEncrKey);/* * FUNCTION: CRMF_EncryptedKeyGetEncryptedValue * INPUTS: *    inKey *        The EncryptedKey to operate on. * * NOTES: * The user must call CRMF_DestroyEncryptedValue passing in  * CRMF_GetEncryptedValue's return value. * * RETURN: * A pointer to a copy of the EncryptedValue contained as a member of * the EncryptedKey. */extern CRMFEncryptedValue*        CRMF_EncryptedKeyGetEncryptedValue(CRMFEncryptedKey *inKey);/* * FUNCTION: CRMF_DestroyEncryptedValue * INPUTS: *    inEncrValue *        The EncryptedValue to destroy. * * NOTES: * Free up all memory associated with 'inEncrValue'. * * RETURN: * SECSuccess if freeing up the memory associated with the EncryptedValue * is successful. Any other return value indicates an error while freeing the * memory. */extern SECStatus CRMF_DestroyEncryptedValue(CRMFEncryptedValue *inEncrValue);/* * FUNCTION: CRMF_EncryptedValueGetEncValue * INPUTS: *    inEncValue *        The EncryptedValue to operate on. * NOTES: * Function retrieves the encValue from an EncryptedValue structure. * * RETURN: * A poiner to a SECItem containing the encValue of the EncryptedValue * structure.  The return value is in BIT STRING format, meaning the * len field of the return structure represents the number of valid bits * as opposed to the allocated number of bytes. * ANULL return value indicates an error in copying the encValue field. */extern SECItem* CRMF_EncryptedValueGetEncValue(CRMFEncryptedValue *inEncValue);/* * FUNCTION: CRMF_EncryptedValueGetIntendedAlg * INPUTS *    inEncValue *        The EncryptedValue to operate on. * NOTES: * Retrieve the IntendedAlg field from the EncryptedValue structure. * Call SECOID_DestroyAlgorithmID (destAlgID, PR_TRUE) after done using * the return value.  When present, this alogorithm is the alogrithm for * which the private key will be used. * * RETURN: * A Copy of the intendedAlg field.  A NULL return value indicates the * optional field was not present in the structure. */extern SECAlgorithmID*        CRMF_EncryptedValueGetIntendedAlg(CRMFEncryptedValue  *inEncValue);/* * FUNCTION: CRMF_EncryptedValueGetSymmAlg * INPUTS *    inEncValue *        The EncryptedValue to operate on. * NOTES: * Retrieve the symmAlg field from the EncryptedValue structure. * Call SECOID_DestroyAlgorithmID (destAlgID, PR_TRUE) after done using * the return value.  When present, this is algorithm used to * encrypt the encValue of the EncryptedValue. * * RETURN: * A Copy of the symmAlg field.  A NULL return value indicates the * optional field was not present in the structure. */extern SECAlgorithmID*        CRMF_EncryptedValueGetSymmAlg(CRMFEncryptedValue  *inEncValue);/* * FUNCTION: CRMF_EncryptedValueGetKeyAlg * INPUTS *    inEncValue *        The EncryptedValue to operate on. * NOTES: * Retrieve the keyAlg field from the EncryptedValue structure. * Call SECOID_DestroyAlgorithmID (destAlgID, PR_TRUE) after done using * the return value.  When present, this is the algorithm used to encrypt * the symmetric key in the encSymmKey field of the EncryptedValue structure. * * RETURN: * A Copy of the keyAlg field.  A NULL return value indicates the * optional field was not present in the structure. */extern SECAlgorithmID*        CRMF_EncryptedValueGetKeyAlg(CRMFEncryptedValue *inEncValue);/* * FUNCTION: CRMF_EncryptedValueGetValueHint * INPUTS: *    inEncValue *        The EncryptedValue to operate on. * * NOTES: * Return a copy of the der-encoded value hint. * User must call SECITEM_FreeItem(retVal, PR_TRUE) when done using the * return value.  When, present, this is a value that the client which * originally issued a certificate request can use to reproduce any data * it wants.  The RA does not know how to interpret this data. * * RETURN: * A copy of the valueHint field of the EncryptedValue.  A NULL return * value indicates the optional valueHint field is not present in the * EncryptedValue. */extern SECItem*        CRMF_EncryptedValueGetValueHint(CRMFEncryptedValue  *inEncValue);/* * FUNCTION: CRMF_EncrypteValueGetEncSymmKey * INPUTS:  *    inEncValue *        The EncryptedValue to operate on. * * NOTES: * Return a copy of the encSymmKey field. This field is the encrypted * symmetric key that the client uses in doing Public Key wrap of a private * key.  When present, this is the symmetric key that was used to wrap the * private key.  (The encrypted private key will be stored in encValue * of the same EncryptedValue structure.)  The user must call  * SECITEM_FreeItem(retVal, PR_TRUE) when the return value is no longer * needed. * * RETURN: * A copy of the optional encSymmKey field of the EncryptedValue structure. * The return value will be in BIT STRING format, meaning the len field will * be the number of valid bits as opposed to the number of bytes. A return  * value of NULL means the optional encSymmKey field was not present in * the EncryptedValue structure. */extern SECItem*        CRMF_EncryptedValueGetEncSymmKey(CRMFEncryptedValue *inEncValue);/* * FUNCTION: CRMF_PKIArchiveOptionsGetKeyGenParameters * INPUTS: *    inOptions *        The PKiArchiveOptions to operate on. * * NOTES: * User must call SECITEM_FreeItem(retVal, PR_TRUE) after the return  * value is no longer needed. * * RETURN: * Get the keyGenParameters field of the PKIArchiveOptions. * A NULL return value indicates that keyGenParameters was not  * used as the choice for this PKIArchiveOptions. * * The SECItem returned is in BIT STRING format (ie, the len field indicates * number of valid bits as opposed to allocated number of bytes.) */extern SECItem*    CRMF_PKIArchiveOptionsGetKeyGenParameters(CRMFPKIArchiveOptions *inOptions);/* * FUNCTION: CRMF_PKIArchiveOptionsGetArchiveRemGenPrivKey * INPUTS: *    inOpt *        The PKIArchiveOptions to operate on. *    destVal *        A pointer to where the library can place the value for  *        arciveRemGenPrivKey * RETURN: * If the PKIArchiveOptions used the archiveRemGenPrivKey field, the * function returns SECSuccess and fills the value at *destValue with either * PR_TRUE or PR_FALSE, depending on what the PKIArchiveOptions has as a  * value.  * * If the PKIArchiveOptions does not use the archiveRemGenPrivKey field, the * function returns SECFailure and the value at *destValue is unchanged. */extern SECStatus     CRMF_PKIArchiveOptionsGetArchiveRemGenPrivKey(CRMFPKIArchiveOptions *inOpt,						  PRBool             *destVal);/* Helper functions that can be used by other libraries. *//* * A quick helper funciton to get the best wrap mechanism. */extern CK_MECHANISM_TYPE CRMF_GetBestWrapPadMechanism(PK11SlotInfo *slot); /* * A helper function to get a randomly generated IV from a mechanism  * type. */extern SECItem* CRMF_GetIVFromMechanism(CK_MECHANISM_TYPE mechType); SEC_END_PROTOS#endif /*_CRMF_H_*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?