![]() |
API参考
|
public/private key encode/decode 更多...

函数 | |
| int32_t | CRYPT_EAL_DecodeBuffKey (int32_t format, int32_t type, BSL_Buffer *encode, const uint8_t *pwd, uint32_t pwdlen, CRYPT_EAL_PkeyCtx **ealPKey) |
| Decode formatted buffer of pkey | |
| int32_t | CRYPT_EAL_ProviderDecodeBuffKey (CRYPT_EAL_LibCtx *libCtx, const char *attrName, int32_t pkeyAlgId, const char *format, const char *type, BSL_Buffer *encode, const BSL_Buffer *pwd, CRYPT_EAL_PkeyCtx **ealPKey) |
| Decode formatted buffer of pkey with provider | |
| int32_t | CRYPT_EAL_DecodeFileKey (int32_t format, int32_t type, const char *path, uint8_t *pwd, uint32_t pwdlen, CRYPT_EAL_PkeyCtx **ealPKey) |
| Decode formatted file of pkey | |
| int32_t | CRYPT_EAL_ProviderDecodeFileKey (CRYPT_EAL_LibCtx *libCtx, const char *attrName, int32_t pkeyAlgId, const char *format, const char *type, const char *path, const BSL_Buffer *pwd, CRYPT_EAL_PkeyCtx **ealPKey) |
| Decode formatted file of pkey with extended parameters | |
| int32_t | CRYPT_EAL_EncodeBuffKey (CRYPT_EAL_PkeyCtx *ealPKey, const CRYPT_EncodeParam *encodeParam, int32_t format, int32_t type, BSL_Buffer *encode) |
| Encode formatted buffer of pkey | |
| int32_t | CRYPT_EAL_ProviderEncodeBuffKey (CRYPT_EAL_LibCtx *libCtx, const char *attrName, CRYPT_EAL_PkeyCtx *ealPKey, const CRYPT_EncodeParam *encodeParam, const char *format, const char *type, BSL_Buffer *encode) |
| Encode formatted buffer of pkey with provider | |
| int32_t | CRYPT_EAL_EncodeFileKey (CRYPT_EAL_PkeyCtx *ealPKey, const CRYPT_EncodeParam *encodeParam, int32_t format, int32_t type, const char *path) |
| Encode formatted file of pkey | |
| int32_t | CRYPT_EAL_ProviderEncodeFileKey (CRYPT_EAL_LibCtx *libCtx, const char *attrName, CRYPT_EAL_PkeyCtx *ealPKey, const CRYPT_EncodeParam *encodeParam, const char *format, const char *type, const char *path) |
| Encode formatted file of pkey with provider | |
public/private key encode/decode
| int32_t CRYPT_EAL_DecodeBuffKey | ( | int32_t | format, |
| int32_t | type, | ||
| BSL_Buffer * | encode, | ||
| const uint8_t * | pwd, | ||
| uint32_t | pwdlen, | ||
| CRYPT_EAL_PkeyCtx ** | ealPKey ) |
Decode formatted buffer of pkey
| format | [IN] the buffer format: BSL_FORMAT_UNKNOWN/BSL_FORMAT_PEM/BSL_FORMAT_DER |
| type | [IN] the type of pkey, see CRYPT_ENCDEC_TYPE |
| encode | [IN] the encoded asn1 buffer. BSL_FORMAT_UNKNOWN/BSL_FORMAT_PEM: the buff of encode needs to end with '\0' the dataLen should exclude the end '\0' |
| pwd | [IN] the password, maybe NULL for unencrypted private key / public key. |
| pwdlen | [IN] the length of password. |
| ealPKey | [OUT] created CRYPT_EAL_PkeyCtx which parsed from the ans1 buffer. |
| CRYPT_SUCCESS,if | success. Other error codes see the crypt_errno.h |
| int32_t CRYPT_EAL_DecodeFileKey | ( | int32_t | format, |
| int32_t | type, | ||
| const char * | path, | ||
| uint8_t * | pwd, | ||
| uint32_t | pwdlen, | ||
| CRYPT_EAL_PkeyCtx ** | ealPKey ) |
Decode formatted file of pkey
| format | [IN] the file format: BSL_FORMAT_UNKNOWN/BSL_FORMAT_PEM/BSL_FORMAT_DER |
| type | [IN] the type of pkey, see CRYPT_ENCDEC_TYPE |
| path | [IN] the encoded file path. |
| pwd | [IN] the password, maybe NULL for unencrypted private key / public key. |
| pwdlen | [IN] the length of password. |
| ealPKey | [OUT] created CRYPT_EAL_PkeyCtx which parsed from the path. |
| CRYPT_SUCCESS,if | success. Other error codes see the crypt_errno.h |
| int32_t CRYPT_EAL_EncodeBuffKey | ( | CRYPT_EAL_PkeyCtx * | ealPKey, |
| const CRYPT_EncodeParam * | encodeParam, | ||
| int32_t | format, | ||
| int32_t | type, | ||
| BSL_Buffer * | encode ) |
Encode formatted buffer of pkey
| ealPKey | [IN] CRYPT_EAL_PkeyCtx to encode. |
| encodeParam | [IN] pkcs8 encode params. |
| format | [IN] the file format: BSL_FORMAT_UNKNOWN/BSL_FORMAT_PEM/BSL_FORMAT_DER |
| type | [IN] the type of pkey, see CRYPT_ENCDEC_TYPE |
| encode | [OUT] the encoded asn1 buffer. |
| CRYPT_SUCCESS,if | success. Other error codes see the crypt_errno.h |
| int32_t CRYPT_EAL_EncodeFileKey | ( | CRYPT_EAL_PkeyCtx * | ealPKey, |
| const CRYPT_EncodeParam * | encodeParam, | ||
| int32_t | format, | ||
| int32_t | type, | ||
| const char * | path ) |
Encode formatted file of pkey
| ealPKey | [IN] CRYPT_EAL_PkeyCtx to encode. |
| encodeParam | [IN] pkcs8 encode params. |
| format | [IN] the file format: BSL_FORMAT_UNKNOWN/BSL_FORMAT_PEM/BSL_FORMAT_DER |
| type | [IN] the type of pkey, see CRYPT_ENCDEC_TYPE |
| path | [IN] the encoded file path. |
| CRYPT_SUCCESS,if | success. Other error codes see the crypt_errno.h |
| int32_t CRYPT_EAL_ProviderDecodeBuffKey | ( | CRYPT_EAL_LibCtx * | libCtx, |
| const char * | attrName, | ||
| int32_t | pkeyAlgId, | ||
| const char * | format, | ||
| const char * | type, | ||
| BSL_Buffer * | encode, | ||
| const BSL_Buffer * | pwd, | ||
| CRYPT_EAL_PkeyCtx ** | ealPKey ) |
Decode formatted buffer of pkey with provider
| libCtx | [IN] the library context of provider. |
| attrName | [IN] provider attribute name, maybe NULL. |
| pkeyAlgId | [IN] Input pkey algorithm ID, see CRYPT_PKEY_AlgId |
| format | [IN] the buffer format: "ASN1" "PEM" "PFX_COM" "PKCS12" "OBJECT" |
| type | [IN] the type of pkey: "PRIKEY_PKCS8_UNENCRYPT" "PRIKEY_PKCS8_ENCRYPT" "PRIKEY_RSA" "PRIKEY_ECC" "PUBKEY_SUBKEY" "PUBKEY_RSA" "PUBKEY_SUBKEY_WITHOUT_SEQ" |
| encode | [IN] the encoded asn1 buffer. BSL_FORMAT_UNKNOWN/BSL_FORMAT_PEM: the buff of encode needs to end with '\0' the dataLen should exclude the end '\0' |
| pwd | [IN] the password buffer, maybe NULL for unencrypted private key / public key. |
| ealPKey | [OUT] created CRYPT_EAL_PkeyCtx which parsed from the ans1 buffer. |
| CRYPT_SUCCESS,if | success. Other error codes see the crypt_errno.h |
| int32_t CRYPT_EAL_ProviderDecodeFileKey | ( | CRYPT_EAL_LibCtx * | libCtx, |
| const char * | attrName, | ||
| int32_t | pkeyAlgId, | ||
| const char * | format, | ||
| const char * | type, | ||
| const char * | path, | ||
| const BSL_Buffer * | pwd, | ||
| CRYPT_EAL_PkeyCtx ** | ealPKey ) |
Decode formatted file of pkey with extended parameters
| libCtx | [IN] the library context of provider. |
| attrName | [IN] provider attribute name, maybe NULL. |
| pkeyAlgId | [IN] Input pkey algorithm ID, see CRYPT_PKEY_AlgId |
| format | [IN] the file format: "ASN1" "PEM" "PFX_COM" "PKCS12" "OBJECT" |
| type | [IN] the type of pkey: "PRIKEY_PKCS8_UNENCRYPT" "PRIKEY_PKCS8_ENCRYPT" "PRIKEY_RSA" "PRIKEY_ECC" "PUBKEY_SUBKEY" "PUBKEY_RSA" "PUBKEY_SUBKEY_WITHOUT_SEQ" |
| path | [IN] the encoded file path. |
| pwd | [IN] the password buffer, maybe NULL for unencrypted private key / public key. |
| ealPKey | [OUT] created CRYPT_EAL_PkeyCtx which parsed from the path. |
| CRYPT_SUCCESS,if | success. Other error codes see the crypt_errno.h |
| int32_t CRYPT_EAL_ProviderEncodeBuffKey | ( | CRYPT_EAL_LibCtx * | libCtx, |
| const char * | attrName, | ||
| CRYPT_EAL_PkeyCtx * | ealPKey, | ||
| const CRYPT_EncodeParam * | encodeParam, | ||
| const char * | format, | ||
| const char * | type, | ||
| BSL_Buffer * | encode ) |
Encode formatted buffer of pkey with provider
| libCtx | [IN] the library context of provider. |
| attrName | [IN] provider attribute name, maybe NULL. |
| ealPKey | [IN] CRYPT_EAL_PkeyCtx to encode. |
| encodeParam | [IN] pkcs8 encode params. |
| format | [IN] the buffer format: "ASN1" "PEM" "PFX_COM" "PKCS12" "OBJECT" |
| type | [IN] the type of pkey: "PRIKEY_PKCS8_UNENCRYPT" "PRIKEY_PKCS8_ENCRYPT" "PRIKEY_RSA" "PRIKEY_ECC" "PUBKEY_SUBKEY" "PUBKEY_RSA" "PUBKEY_SUBKEY_WITHOUT_SEQ" |
| encode | [OUT] the encoded asn1 buffer. |
| CRYPT_SUCCESS,if | success. Other error codes see the crypt_errno.h |
| int32_t CRYPT_EAL_ProviderEncodeFileKey | ( | CRYPT_EAL_LibCtx * | libCtx, |
| const char * | attrName, | ||
| CRYPT_EAL_PkeyCtx * | ealPKey, | ||
| const CRYPT_EncodeParam * | encodeParam, | ||
| const char * | format, | ||
| const char * | type, | ||
| const char * | path ) |
Encode formatted file of pkey with provider
| libCtx | [IN] the library context of provider. |
| attrName | [IN] provider attribute name, maybe NULL. |
| ealPKey | [IN] CRYPT_EAL_PkeyCtx to encode. |
| encodeParam | [IN] pkcs8 encode params. |
| format | [IN] the file format: "ASN1" "PEM" "PFX_COM" "PKCS12" "OBJECT" |
| type | [IN] the type of pkey: "PRIKEY_PKCS8_UNENCRYPT" "PRIKEY_PKCS8_ENCRYPT" "PRIKEY_RSA" "PRIKEY_ECC" "PUBKEY_SUBKEY" "PUBKEY_RSA" "PUBKEY_SUBKEY_WITHOUT_SEQ" |
| path | [IN] the encoded file path. |
| CRYPT_SUCCESS,if | success. Other error codes see the crypt_errno.h |