openHiTLS API openHiTLS 0.1.0-Alpha1
结构体 | 类型定义 | 函数
Hitls_cert_reg

Certificate related interfaces to be registered 更多...

Hitls_cert_reg 的协作图:

结构体

struct  HITLS_CRYPT_BaseMethod
 Callback function that must be registered 更多...
 
struct  HITLS_CRYPT_EcdhMethod
 ECDH Callback function to be registered 更多...
 
struct  HITLS_CRYPT_DhMethod
 DH Callback function to be registered 更多...
 
struct  HITLS_CRYPT_KdfMethod
 KDF function 更多...
 

类型定义

typedef HITLS_CERT_Store *(* CERT_StoreNewCallBack) (void)
 Create a certificate store
 
typedef HITLS_CERT_Store *(* CERT_StoreDupCallBack) (HITLS_CERT_Store *store)
 Duplicate the certificate store.
 
typedef void(* CERT_StoreFreeCallBack) (HITLS_CERT_Store *store)
 Release the certificate store.
 
typedef int32_t(* CERT_StoreCtrlCallBack) (HITLS_Config *config, HITLS_CERT_Store *store, HITLS_CERT_CtrlCmd cmd, void *input, void *output)
 ctrl interface
 
typedef int32_t(* CERT_BuildCertChainCallBack) (HITLS_Config *config, HITLS_CERT_Store *store, HITLS_CERT_X509 *cert, HITLS_CERT_X509 **certList, uint32_t *num)
 Create a certificate chain based on the device certificate in use.
 
typedef int32_t(* CERT_VerifyCertChainCallBack) (HITLS_Ctx *ctx, HITLS_CERT_Store *store, HITLS_CERT_X509 **certList, uint32_t num)
 Verify the certificate chain
 
typedef int32_t(* CERT_CertEncodeCallBack) (HITLS_Ctx *ctx, HITLS_CERT_X509 *cert, uint8_t *buf, uint32_t len, uint32_t *usedLen)
 Encode the certificate in ASN.1 DER format.
 
typedef HITLS_CERT_X509 *(* CERT_CertParseCallBack) (HITLS_Config *config, const uint8_t *buf, uint32_t len, HITLS_ParseType type, HITLS_ParseFormat format)
 Read the certificate.
 
typedef HITLS_CERT_X509 *(* CERT_CertDupCallBack) (HITLS_CERT_X509 *cert)
 Duplicate the certificate.
 
typedef HITLS_CERT_X509 *(* CERT_CertRefCallBack) (HITLS_CERT_X509 *cert)
 Certificate reference counting plus one.
 
typedef void(* CERT_CertFreeCallBack) (HITLS_CERT_X509 *cert)
 Release the certificate.
 
typedef int32_t(* CERT_CertCtrlCallBack) (HITLS_Config *config, HITLS_CERT_X509 *cert, HITLS_CERT_CtrlCmd cmd, void *input, void *output)
 Ctrl interface
 
typedef HITLS_CERT_Key *(* CERT_KeyParseCallBack) (HITLS_Config *config, const uint8_t *buf, uint32_t len, HITLS_ParseType type, HITLS_ParseFormat format)
 Read the certificate key.
 
typedef HITLS_CERT_Key *(* CERT_KeyDupCallBack) (HITLS_CERT_Key *key)
 Duplicate the certificate key.
 
typedef void(* CERT_KeyFreeCallBack) (HITLS_CERT_Key *key)
 Release the certificate key.
 
typedef int32_t(* CERT_KeyCtrlCallBack) (HITLS_Config *config, HITLS_CERT_Key *key, HITLS_CERT_CtrlCmd cmd, void *input, void *output)
 Ctrl interface
 
typedef int32_t(* CERT_CreateSignCallBack) (HITLS_Ctx *ctx, HITLS_CERT_Key *key, HITLS_SignAlgo signAlgo, HITLS_HashAlgo hashAlgo, const uint8_t *data, uint32_t dataLen, uint8_t *sign, uint32_t *signLen)
 Signature
 
typedef int32_t(* CERT_VerifySignCallBack) (HITLS_Ctx *ctx, HITLS_CERT_Key *key, HITLS_SignAlgo signAlgo, HITLS_HashAlgo hashAlgo, const uint8_t *data, uint32_t dataLen, const uint8_t *sign, uint32_t signLen)
 Signature verification
 
typedef int32_t(* CERT_EncryptCallBack) (HITLS_Ctx *ctx, HITLS_CERT_Key *key, const uint8_t *in, uint32_t inLen, uint8_t *out, uint32_t *outLen)
 Encrypted by the certificate public key.
 
typedef int32_t(* CERT_DecryptCallBack) (HITLS_Ctx *ctx, HITLS_CERT_Key *key, const uint8_t *in, uint32_t inLen, uint8_t *out, uint32_t *outLen)
 Use the certificate private key to decrypt the data.
 
typedef int32_t(* CERT_CheckPrivateKeyCallBack) (const HITLS_Config *config, HITLS_CERT_X509 *cert, HITLS_CERT_Key *key)
 Check whether the private key matches the certificate.
 
typedef int32_t(* CERT_KeyToUserKeyCallBack) (HITLS_CERT_Key *srcKey, HITLS_CERT_USER_Key **desKey)
 Callback for converting the underlying key of the hitls to the upper layer user (adaptation layer)
 
typedef int32_t(* CERT_KeyFormUserKeyCallBack) (HITLS_CERT_USER_Key *srcKey, HITLS_CERT_Key **desKey)
 Callback for converting the key of the upper layer user (adaptation layer) to the key of the bottom layer hitls.
 
typedef HITLS_CERT_USER_Key *(* CERT_UserKeyDupCallBack) (HITLS_CERT_USER_Key *key)
 Duplicate the certificate key.
 
typedef void(* CERT_UserKeyFreeCallBack) (HITLS_CERT_USER_Key *userKey)
 Callback for releasing the key of the upper layer user (adaptation layer).
 

函数

int32_t HITLS_CERT_RegisterMgrMethod (HITLS_CERT_MgrMethod *method)
 Callback function related to certificate registration
 
void HITLS_CERT_DeinitMgrMethod (void)
 Certificate deregistration callback function
 
int32_t HITLS_CERT_RegisterUserKeyMgrMethod (HITLS_CERT_UserKeyMgrMethod *method)
 Callback function related to register the certificate UserKey. Before calling this API, ensure that the HITLS_CERT_RegisterMgrMethod is successfully registered.
 
void HITLS_CERT_DeinitUserKeyMgrMethod (void)
 Callback functions related to the deregistration certificate UserKey
 
int32_t HITLS_CFG_SetCheckPriKeyCb (HITLS_Config *config, CERT_CheckPrivateKeyCallBack checkPrivateKey)
 Register the private key with the config file and certificate matching Check Interface.
 
CERT_CheckPrivateKeyCallBack HITLS_CFG_GetCheckPriKeyCb (HITLS_Config *config)
 Interface for obtaining the registered private key and certificate matching check
 
int32_t HITLS_CRYPT_RegisterBaseMethod (HITLS_CRYPT_BaseMethod *userCryptCallBack)
 Register the basic callback function.
 
int32_t HITLS_CRYPT_RegisterEcdhMethod (HITLS_CRYPT_EcdhMethod *userCryptCallBack)
 Register the ECDH callback function.
 
int32_t HITLS_CRYPT_RegisterDhMethod (const HITLS_CRYPT_DhMethod *userCryptCallBack)
 Register the callback function of the DH.
 

详细描述

Certificate related interfaces to be registered