openHiTLS API openHiTLS 0.1.0-Alpha1
|
TLS Certificate Operation Interface 更多...
类型定义 | |
typedef int32_t(* | HITLS_PasswordCb) (char *buf, int32_t bufLen, int32_t flag, void *userdata) |
Password Callback | |
typedef int(* | HITLS_VerifyCb) (int32_t isPreverifyOk, HITLS_CERT_StoreCtx *storeCtx) |
Certificate verification callback | |
函数 | |
int32_t | HITLS_CFG_SetVerifyStore (HITLS_Config *config, HITLS_CERT_Store *store, bool isClone) |
Set the verify store used by the TLS configuration, which is used for certificate verification. | |
HITLS_CERT_Store * | HITLS_CFG_GetVerifyStore (const HITLS_Config *config) |
Obtain the verify store used by the TLS configuration. | |
int32_t | HITLS_SetVerifyStore (HITLS_Ctx *ctx, HITLS_CERT_Store *store, bool isClone) |
Set the verify store used by the TLS link for certificate verification. | |
HITLS_CERT_Store * | HITLS_GetVerifyStore (const HITLS_Ctx *ctx) |
Obtain the verify store used by the TLS link. | |
int32_t | HITLS_CFG_SetChainStore (HITLS_Config *config, HITLS_CERT_Store *store, bool isClone) |
Set the chain store used by the TLS configuration, which is used to construct the certificate chain. | |
HITLS_CERT_Store * | HITLS_CFG_GetChainStore (const HITLS_Config *config) |
Obtain the chain store used by the TLS configuration. | |
int32_t | HITLS_SetChainStore (HITLS_Ctx *ctx, HITLS_CERT_Store *store, bool isClone) |
Set the chain store used by the TLS link to construct the certificate chain. | |
HITLS_CERT_Store * | HITLS_GetChainStore (const HITLS_Ctx *ctx) |
Obtain the chain store used by the TLS link. | |
int32_t | HITLS_CFG_SetCertStore (HITLS_Config *config, HITLS_CERT_Store *store, bool isClone) |
Set the cert store used by the TLS configuration. | |
HITLS_CERT_Store * | HITLS_CFG_GetCertStore (const HITLS_Config *config) |
Obtain the cert store used by the TLS configuration. | |
int32_t | HITLS_SetCertStore (HITLS_Ctx *ctx, HITLS_CERT_Store *store, bool isClone) |
Set the cert store used by the TLS link. | |
HITLS_CERT_Store * | HITLS_GetCertStore (const HITLS_Ctx *ctx) |
Obtain the cert store used by the TLS link. | |
int32_t | HITLS_CFG_SetVerifyDepth (HITLS_Config *config, uint32_t depth) |
Set the certificate verification depth. | |
int32_t | HITLS_CFG_GetVerifyDepth (const HITLS_Config *config, uint32_t *depth) |
Obtain the certificate verification depth. | |
int32_t | HITLS_SetVerifyDepth (HITLS_Ctx *ctx, uint32_t depth) |
Set the certificate verification depth. | |
int32_t | HITLS_GetVerifyDepth (const HITLS_Ctx *ctx, uint32_t *depth) |
Obtain the certificate verification depth. | |
int32_t | HITLS_CFG_SetDefaultPasswordCb (HITLS_Config *config, HITLS_PasswordCb cb) |
Set the default password callback, cb can be NULL. | |
HITLS_PasswordCb | HITLS_CFG_GetDefaultPasswordCb (HITLS_Config *config) |
Callback for obtaining the default password. | |
int32_t | HITLS_CFG_SetDefaultPasswordCbUserdata (HITLS_Config *config, void *userdata) |
Set the user data used by the password callback. | |
void * | HITLS_CFG_GetDefaultPasswordCbUserdata (HITLS_Config *config) |
Obtain the user data used by the password callback. | |
int32_t | HITLS_SetDefaultPasswordCb (HITLS_Ctx *ctx, HITLS_PasswordCb cb) |
Set the default password callback, cb can be NULL | |
HITLS_PasswordCb | HITLS_GetDefaultPasswordCb (HITLS_Ctx *ctx) |
Callback for obtaining the default password | |
int32_t | HITLS_SetDefaultPasswordCbUserdata (HITLS_Ctx *ctx, void *userdata) |
Set the user data used by the default password callback. | |
void * | HITLS_GetDefaultPasswordCbUserdata (HITLS_Ctx *ctx) |
Obtain the user data used by the default password callback. | |
int32_t | HITLS_CFG_SetTlcpCertificate (HITLS_Config *config, HITLS_CERT_X509 *cert, bool isClone, bool isTlcpEncCert) |
Add the device certificate by the ShangMi(SM) cipher suites. Only one certificate can be added for each type. | |
int32_t | HITLS_CFG_SetTlcpPrivateKey (HITLS_Config *config, HITLS_CERT_Key *privateKey, bool isClone, bool isTlcpEncCertPriKey) |
Add the private key of the device certificate by the ShangMi(SM) cipher suites. Only one private key can be added for each type of certificate. | |
int32_t | HITLS_CFG_SetCertificate (HITLS_Config *config, HITLS_CERT_X509 *cert, bool isClone) |
Add a device certificate. Only one certificate of each type can be added | |
int32_t | HITLS_CFG_LoadCertFile (HITLS_Config *config, const char *file, HITLS_ParseFormat format) |
Load the device certificate from the file. | |
int32_t | HITLS_CFG_LoadCertBuffer (HITLS_Config *config, const uint8_t *buf, uint32_t bufLen, HITLS_ParseFormat format) |
Read the device certificate from the buffer. | |
HITLS_CERT_X509 * | HITLS_CFG_GetCertificate (const HITLS_Config *config) |
Obtain the device certificate in use. | |
int32_t | HITLS_SetCertificate (HITLS_Ctx *ctx, HITLS_CERT_X509 *cert, bool isClone) |
Add a device certificate. Only one certificate can be added for each type. | |
int32_t | HITLS_LoadCertFile (HITLS_Ctx *ctx, const char *file, HITLS_ParseFormat format) |
Use a file to set the device certificate. | |
int32_t | HITLS_LoadCertBuffer (HITLS_Ctx *ctx, const uint8_t *buf, uint32_t bufLen, HITLS_ParseFormat format) |
Read the device certificate from the buffer. | |
HITLS_CERT_X509 * | HITLS_GetCertificate (const HITLS_Ctx *ctx) |
Obtain the local certificate. | |
HITLS_CERT_X509 * | HITLS_GetPeerCertificate (const HITLS_Ctx *ctx) |
Obtain the peer certificate. | |
int32_t | HITLS_CFG_SetPrivateKey (HITLS_Config *config, HITLS_CERT_Key *privateKey, bool isClone) |
Add the private key of the device certificate. Only one private key can be added for each type of certificate. | |
int32_t | HITLS_CFG_LoadKeyFile (HITLS_Config *config, const char *file, HITLS_ParseFormat format) |
Load the private key of the device certificate from the file. | |
int32_t | HITLS_CFG_LoadKeyBuffer (HITLS_Config *config, const uint8_t *buf, uint32_t bufLen, HITLS_ParseFormat format) |
Read the private key of the device certificate from the buffer. | |
HITLS_CERT_Key * | HITLS_CFG_GetPrivateKey (const HITLS_Config *config) |
Obtain the private key of the certificate in use. | |
int32_t | HITLS_CFG_CheckPrivateKey (const HITLS_Config *config) |
Check whether the configured certificate matches the private key. | |
int32_t | HITLS_SetPrivateKey (HITLS_Ctx *ctx, HITLS_CERT_Key *key, bool isClone) |
Add the private key of the device certificate. | |
int32_t | HITLS_LoadKeyFile (HITLS_Ctx *ctx, const char *file, HITLS_ParseFormat format) |
Use the file to set the device private key. | |
int32_t | HITLS_LoadKeyBuffer (HITLS_Ctx *ctx, const uint8_t *buf, uint32_t bufLen, HITLS_ParseFormat format) |
Read the private key of the device certificate from the buffer. | |
HITLS_CERT_Key * | HITLS_GetPrivateKey (HITLS_Ctx *ctx) |
Obtain the private key of the certificate in use. | |
int32_t | HITLS_CheckPrivateKey (const HITLS_Ctx *ctx) |
Check whether the configured certificate matches the private key. | |
int32_t | HITLS_CFG_AddChainCert (HITLS_Config *config, HITLS_CERT_X509 *cert, bool isClone) |
Add the certificate to the certificate chain that is being used by the current config. | |
int32_t | HITLS_CFG_AddCertToStore (HITLS_Config *config, char *certPath, HITLS_CERT_StoreType storeType) |
Add the certificate to the certificate store that is being used by the current config. | |
HITLS_CERT_Chain * | HITLS_CFG_GetChainCerts (HITLS_Config *config) |
Obtain the certificate chain that is being used by the current config. | |
int32_t | HITLS_CFG_ClearChainCerts (HITLS_Config *config) |
Clear the certificate chain associated with the current certificate. | |
int32_t | HITLS_ClearChainCerts (HITLS_Ctx *ctx) |
Clear the certificate in the current certificate. | |
int32_t | HITLS_CFG_RemoveCertAndKey (HITLS_Config *config) |
Release all loaded certificates and private keys. | |
int32_t | HITLS_RemoveCertAndKey (HITLS_Ctx *ctx) |
Release all loaded certificates and private keys. | |
int32_t | HITLS_CFG_SetVerifyCb (HITLS_Config *config, HITLS_VerifyCb callback) |
Set the certificate verification callback function, cb can be NULL. | |
HITLS_VerifyCb | HITLS_CFG_GetVerifyCb (const HITLS_Config *config) |
Obtain the certificate verification callback function. | |
int32_t | HITLS_SetVerifyCb (HITLS_Ctx *ctx, HITLS_VerifyCb callback) |
Set the certificate verification callback function, cb can be NULL. | |
HITLS_VerifyCb | HITLS_GetVerifyCb (const HITLS_Ctx *ctx) |
Obtain the certificate verification callback function. | |
int32_t | HITLS_SetVerifyResult (HITLS_Ctx *ctx, HITLS_ERROR verifyResult) |
Set the peer certificate verification result of the current context. | |
int32_t | HITLS_GetVerifyResult (const HITLS_Ctx *ctx, HITLS_ERROR *verifyResult) |
Return the peer certificate verification result of the current context. | |
HITLS_CERT_Chain * | HITLS_GetPeerCertChain (const HITLS_Ctx *ctx) |
Obtain the peer certificate chain. | |
HITLS_TrustedCAList * | HITLS_GetClientCAList (const HITLS_Ctx *ctx) |
Obtain the trusted CA list of the peer end. | |
int32_t | HITLS_CFG_AddExtraChainCert (HITLS_Config *config, HITLS_CERT_X509 *cert) |
Add a certificate to the attached certificate chain. | |
HITLS_CERT_Chain * | HITLS_CFG_GetExtraChainCerts (HITLS_Config *config) |
Obtain the attached certificate chain. | |
TLS Certificate Operation Interface