API参考
载入中...
搜索中...
未找到
Crypt_eal_codecs

public/private key encode/decode 更多...

Crypt_eal_codecs 的协作图:

函数

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

函数说明

◆ CRYPT_EAL_DecodeBuffKey()

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,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_DecodeFileKey()

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,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_EncodeBuffKey()

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,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_EncodeFileKey()

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,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderDecodeBuffKey()

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,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderDecodeFileKey()

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,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderEncodeBuffKey()

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,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderEncodeFileKey()

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,ifsuccess. Other error codes see the crypt_errno.h