![]() |
API参考
|
PKCS#12 processing interfaces. 更多...

函数 | |
| HITLS_PKCS12 * | HITLS_PKCS12_New (void) |
| Allocate a pkcs12 struct. | |
| HITLS_PKCS12 * | HITLS_PKCS12_ProviderNew (HITLS_PKI_LibCtx *libCtx, const char *attrName) |
| Allocate a pkcs12 struct. | |
| void | HITLS_PKCS12_Free (HITLS_PKCS12 *p12) |
| Release the pkcs12 context. | |
| HITLS_PKCS12_Bag * | HITLS_PKCS12_BagNew (uint32_t bagId, uint32_t bagType, void *bagValue) |
| Allocate a bag struct, which could store a cert or key and its attributes. | |
| void | HITLS_PKCS12_BagFree (HITLS_PKCS12_Bag *bag) |
| Release the bag context. | |
| int32_t | HITLS_PKCS12_BagCtrl (HITLS_PKCS12_Bag *bag, int32_t cmd, void *val, uint32_t valType) |
| Generic function to set a p12 context. | |
| int32_t | HITLS_PKCS12_Ctrl (HITLS_PKCS12 *p12, int32_t cmd, void *val, uint32_t valLen) |
| Generic function to set a p12 context. | |
| int32_t | HITLS_PKCS12_ParseBuff (int32_t format, const BSL_Buffer *encode, const HITLS_PKCS12_PwdParam *pwdParam, HITLS_PKCS12 **p12, bool needMacVerify) |
| pkcs12 parse | |
| int32_t | HITLS_PKCS12_ProviderParseBuff (HITLS_PKI_LibCtx *libCtx, const char *attrName, const char *format, const BSL_Buffer *encode, const HITLS_PKCS12_PwdParam *pwdParam, HITLS_PKCS12 **p12, bool needMacVerify) |
| pkcs12 parse | |
| int32_t | HITLS_PKCS12_ParseFile (int32_t format, const char *path, const HITLS_PKCS12_PwdParam *pwdParam, HITLS_PKCS12 **p12, bool needMacVerify) |
| int32_t | HITLS_PKCS12_ProviderParseFile (HITLS_PKI_LibCtx *libCtx, const char *attrName, const char *format, const char *path, const HITLS_PKCS12_PwdParam *pwdParam, HITLS_PKCS12 **p12, bool needMacVerify) |
| pkcs12 parse file | |
| int32_t | HITLS_PKCS12_GenBuff (int32_t format, HITLS_PKCS12 *p12, const HITLS_PKCS12_EncodeParam *encodeParam, bool isNeedMac, BSL_Buffer *encode) |
| pkcs12 gen | |
| int32_t | HITLS_PKCS12_GenFile (int32_t format, HITLS_PKCS12 *p12, const HITLS_PKCS12_EncodeParam *encodeParam, bool isNeedMac, const char *path) |
PKCS#12 processing interfaces.
| int32_t HITLS_PKCS12_BagCtrl | ( | HITLS_PKCS12_Bag * | bag, |
| int32_t | cmd, | ||
| void * | val, | ||
| uint32_t | valType ) |
Generic function to set a p12 context.
| bag | [IN] bag context. |
| cmd | [IN] HITLS_PKCS12_XXX |
| val | [IN/OUT] input and output value |
| valType | [In] value type or length |
| #HITLS_PKI_SUCCESS,success. | Error codes can be found in hitls_pki_errno.h |
| void HITLS_PKCS12_BagFree | ( | HITLS_PKCS12_Bag * | bag | ) |
Release the bag context.
| bag | [IN] bag context. |
| void |
| HITLS_PKCS12_Bag * HITLS_PKCS12_BagNew | ( | uint32_t | bagId, |
| uint32_t | bagType, | ||
| void * | bagValue ) |
Allocate a bag struct, which could store a cert or key and its attributes.
| bagId | [IN] BagId, BSL_CID_PKCS8SHROUDEDKEYBAG/BSL_CID_CERTBAG/BSL_CID_SECRETBAG |
| bagType | [IN] BagType, for example, BSL_CID_X509CERTIFICATE is a bagType of BSL_CID_CERTBAG. |
| bagValue | [IN] bagValue, the bagValue must match the bag-type. Each Bag only holds one piece of information – a key or a certificate... |
| HITLS_PKCS12_Bag | * |
| int32_t HITLS_PKCS12_Ctrl | ( | HITLS_PKCS12 * | p12, |
| int32_t | cmd, | ||
| void * | val, | ||
| uint32_t | valLen ) |
Generic function to set a p12 context.
| p12 | [IN] p12 context. |
| cmd | [IN] HITLS_PKCS12_XXX cmd val type HITLS_PKCS12_GEN_LOCALKEYID AlgId of MD HITLS_PKCS12_SET_ENTITY_KEYBAG a pkey bag HITLS_PKCS12_SET_ENTITY_CERTBAG a cert bag HITLS_PKCS12_ADD_CERTBAG a cert bag HITLS_PKCS12_GET_ENTITY_CERT HITLS_X509_Cert** HITLS_PKCS12_GET_ENTITY_KEY CRYPT_EAL_PkeyCtx** |
| val | [IN/OUT] input and output value |
| valLen | [In] value length |
| #HITLS_PKI_SUCCESS,success. | Error codes can be found in hitls_pki_errno.h |
| void HITLS_PKCS12_Free | ( | HITLS_PKCS12 * | p12 | ) |
Release the pkcs12 context.
| csr | [IN] p12 context. |
| void |
| int32_t HITLS_PKCS12_GenBuff | ( | int32_t | format, |
| HITLS_PKCS12 * | p12, | ||
| const HITLS_PKCS12_EncodeParam * | encodeParam, | ||
| bool | isNeedMac, | ||
| BSL_Buffer * | encode ) |
pkcs12 gen
| format | [IN] Encoding format: BSL_FORMAT_ASN1. |
| p12 | [IN] p12 struct, including entityCert, CA-cert, prvkey, and so on. |
| encodeParam | [IN] encode data |
| isNeedMac | [IN] Identifies whether macData is required. |
| encode | [OUT] result. |
| #HITLS_PKI_SUCCESS,success. | Error codes can be found in hitls_pki_errno.h |
| int32_t HITLS_PKCS12_GenFile | ( | int32_t | format, |
| HITLS_PKCS12 * | p12, | ||
| const HITLS_PKCS12_EncodeParam * | encodeParam, | ||
| bool | isNeedMac, | ||
| const char * | path ) |
| format | [IN] Encoding format: BSL_FORMAT_ASN1. |
| p12 | [IN] p12 struct, including entityCert, CA-cert, prvkey, and so on. |
| encodeParam | [IN] encode data |
| isNeedMac | [IN] Identifies whether macData is required. |
| path | [IN] The path of the generated p12-file. |
| #HITLS_PKI_SUCCESS,success. | Error codes can be found in hitls_pki_errno.h |
| HITLS_PKCS12 * HITLS_PKCS12_New | ( | void | ) |
Allocate a pkcs12 struct.
| HITLS_PKCS12 | * |
| int32_t HITLS_PKCS12_ParseBuff | ( | int32_t | format, |
| const BSL_Buffer * | encode, | ||
| const HITLS_PKCS12_PwdParam * | pwdParam, | ||
| HITLS_PKCS12 ** | p12, | ||
| bool | needMacVerify ) |
pkcs12 parse
| format | [IN] Decoding format: BSL_FORMAT_ASN. |
| encode | [IN] encode data BSL_FORMAT_UNKNOWN/BSL_FORMAT_PEM: the buff of encode needs to end with '\0' the dataLen should exclude the end '\0' |
| pwdParam | [IN] include MAC-pwd, enc-pwd, they can be different. |
| p12 | [OUT] the p12 struct. |
| needMacVerify | [IN] true, need verify mac; false, skip mac check. |
| #HITLS_PKI_SUCCESS,success. | Error codes can be found in hitls_pki_errno.h |
| int32_t HITLS_PKCS12_ParseFile | ( | int32_t | format, |
| const char * | path, | ||
| const HITLS_PKCS12_PwdParam * | pwdParam, | ||
| HITLS_PKCS12 ** | p12, | ||
| bool | needMacVerify ) |
| format | [IN] Encoding format: BSL_FORMAT_ASN1 |
| path | [IN] p12 file path. |
| pwdParam | [IN] include MAC-pwd, enc-pwd, they can be different. |
| p12 | [OUT] the p12 struct. |
| needMacVerify | [IN] true, need verify mac; false, skip mac check. |
| #HITLS_PKI_SUCCESS,success. | Error codes can be found in hitls_pki_errno.h |
| HITLS_PKCS12 * HITLS_PKCS12_ProviderNew | ( | HITLS_PKI_LibCtx * | libCtx, |
| const char * | attrName ) |
Allocate a pkcs12 struct.
| libCtx | [IN] lib context |
| attrName | [IN] attribute name |
| HITLS_PKCS12 | * |
| int32_t HITLS_PKCS12_ProviderParseBuff | ( | HITLS_PKI_LibCtx * | libCtx, |
| const char * | attrName, | ||
| const char * | format, | ||
| const BSL_Buffer * | encode, | ||
| const HITLS_PKCS12_PwdParam * | pwdParam, | ||
| HITLS_PKCS12 ** | p12, | ||
| bool | needMacVerify ) |
pkcs12 parse
| libCtx | [IN] lib context |
| attrName | [IN] attribute name |
| format | [IN] Encoding format: "ASN1" |
| encode | [IN] encode data BSL_FORMAT_UNKNOWN/BSL_FORMAT_PEM: the buff of encode needs to end with '\0' the dataLen should exclude the end '\0' |
| pwdParam | [IN] include MAC-pwd, enc-pwd, they can be different. |
| p12 | [OUT] the p12 struct. |
| needMacVerify | [IN] true, need verify mac; false, skip mac check. |
| #HITLS_PKI_SUCCESS,success. | Error codes can be found in hitls_pki_errno.h |
| int32_t HITLS_PKCS12_ProviderParseFile | ( | HITLS_PKI_LibCtx * | libCtx, |
| const char * | attrName, | ||
| const char * | format, | ||
| const char * | path, | ||
| const HITLS_PKCS12_PwdParam * | pwdParam, | ||
| HITLS_PKCS12 ** | p12, | ||
| bool | needMacVerify ) |
pkcs12 parse file
| libCtx | [IN] lib context |
| attrName | [IN] attribute name |
| format | [IN] Encoding format: "ASN1" |
| path | [IN] p12 file path. |
| pwdParam | [IN] include MAC-pwd, enc-pwd, they can be different. |
| p12 | [OUT] the p12 struct. |
| needMacVerify | [IN] true, need verify mac; false, skip mac check. |
| #HITLS_PKI_SUCCESS,success. | Error codes can be found in hitls_pki_errno.h |