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

PKCS#12 processing interfaces. 更多...

Pkcs12 的协作图:

函数

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.

函数说明

◆ HITLS_PKCS12_BagCtrl()

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

◆ HITLS_PKCS12_BagFree()

void HITLS_PKCS12_BagFree ( HITLS_PKCS12_Bag * bag)

Release the bag context.

参数
bag[IN] bag context.
返回值
void

◆ HITLS_PKCS12_BagNew()

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*

◆ HITLS_PKCS12_Ctrl()

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

◆ HITLS_PKCS12_Free()

void HITLS_PKCS12_Free ( HITLS_PKCS12 * p12)

Release the pkcs12 context.

参数
csr[IN] p12 context.
返回值
void

◆ HITLS_PKCS12_GenBuff()

int32_t HITLS_PKCS12_GenBuff ( int32_t format,
HITLS_PKCS12 * p12,
const HITLS_PKCS12_EncodeParam * encodeParam,
bool isNeedMac,
BSL_Buffer * encode )

pkcs12 gen

Description: gen p12 buffer.
注意
Generate a p12 buffer based on the existing information.
参数
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

◆ HITLS_PKCS12_GenFile()

int32_t HITLS_PKCS12_GenFile ( int32_t format,
HITLS_PKCS12 * p12,
const HITLS_PKCS12_EncodeParam * encodeParam,
bool isNeedMac,
const char * path )
Description: Generate p12 to store in file
注意
Generate a .p12 file based on the existing information.
参数
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_New()

HITLS_PKCS12 * HITLS_PKCS12_New ( void )

Allocate a pkcs12 struct.

返回值
HITLS_PKCS12*

◆ HITLS_PKCS12_ParseBuff()

int32_t HITLS_PKCS12_ParseBuff ( int32_t format,
const BSL_Buffer * encode,
const HITLS_PKCS12_PwdParam * pwdParam,
HITLS_PKCS12 ** p12,
bool needMacVerify )

pkcs12 parse

Description: parse p12 buffer, and set the p12 struct. When the parameter is
BSL_FORMAT_PEM and BSL_FORMAT_UNKNOWN, the buff of encode needs to end with '\0'
注意
Only support to parse p12 buffer in key-integrity and key-privacy protection mode.
参数
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

◆ HITLS_PKCS12_ParseFile()

int32_t HITLS_PKCS12_ParseFile ( int32_t format,
const char * path,
const HITLS_PKCS12_PwdParam * pwdParam,
HITLS_PKCS12 ** p12,
bool needMacVerify )
Description: parse p12 file, and set the p12 struct.
注意
Only support to parse p12 files in key-integrity and key-privacy protection mode.
参数
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_ProviderNew()

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*

◆ HITLS_PKCS12_ProviderParseBuff()

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

Description: parse p12 buffer, and set the p12 struct.
注意
Only support to parse p12 buffer in key-integrity and key-privacy protection mode.
参数
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

◆ HITLS_PKCS12_ProviderParseFile()

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

Description: parse p12 file, and set the p12 struct.
注意
Only support to parse p12 files in key-integrity and key-privacy protection mode.
参数
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