API参考
载入中...
搜索中...
未找到
hitls_cert_reg.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
20
21#ifndef HITLS_CERT_REG_H
22#define HITLS_CERT_REG_H
23
24#include <stdint.h>
25#include "hitls_crypt_type.h"
26#include "hitls_cert_type.h"
27#include "hitls_type.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
41typedef HITLS_CERT_Store *(*CERT_StoreNewCallBack)(void);
42
51typedef HITLS_CERT_Store *(*CERT_StoreDupCallBack)(HITLS_CERT_Store *store);
52
62
76 void *input, void *output);
77
94 HITLS_CERT_X509 **certList, uint32_t *num);
95
109 HITLS_CERT_X509 **certList, uint32_t num);
110
123typedef int32_t (*CERT_CertEncodeCallBack)(HITLS_Ctx *ctx, HITLS_CERT_X509 *cert, uint8_t *buf, uint32_t len,
124 uint32_t *usedLen);
125
140typedef HITLS_CERT_X509 *(*CERT_CertParseCallBack)(HITLS_Config *config, const uint8_t *buf, uint32_t len,
142
151typedef HITLS_CERT_X509 *(*CERT_CertDupCallBack)(HITLS_CERT_X509 *cert);
152
161typedef HITLS_CERT_X509 *(*CERT_CertRefCallBack)(HITLS_CERT_X509 *cert);
162
172
186 void *input, void *output);
187
202typedef HITLS_CERT_Key *(*CERT_KeyParseCallBack)(HITLS_Config *config, const uint8_t *buf, uint32_t len,
204
213typedef HITLS_CERT_Key *(*CERT_KeyDupCallBack)(HITLS_CERT_Key *key);
214
224
238 void *input, void *output);
239
255typedef int32_t (*CERT_CreateSignCallBack)(HITLS_Ctx *ctx, HITLS_CERT_Key *key, HITLS_SignAlgo signAlgo,
256 HITLS_HashAlgo hashAlgo, const uint8_t *data, uint32_t dataLen, uint8_t *sign, uint32_t *signLen);
257
273typedef int32_t (*CERT_VerifySignCallBack)(HITLS_Ctx *ctx, HITLS_CERT_Key *key, HITLS_SignAlgo signAlgo,
274 HITLS_HashAlgo hashAlgo, const uint8_t *data, uint32_t dataLen, const uint8_t *sign, uint32_t signLen);
275
289typedef int32_t (*CERT_EncryptCallBack)(HITLS_Ctx *ctx, HITLS_CERT_Key *key, const uint8_t *in, uint32_t inLen,
290 uint8_t *out, uint32_t *outLen);
291
305typedef int32_t (*CERT_DecryptCallBack)(HITLS_Ctx *ctx, HITLS_CERT_Key *key, const uint8_t *in, uint32_t inLen,
306 uint8_t *out, uint32_t *outLen);
307
319
350
361
371
382
384
395
403
404#ifdef __cplusplus
405}
406#endif
407
408#endif /* HITLS_CERT_REG_H */
void(* CERT_KeyFreeCallBack)(HITLS_CERT_Key *key)
Release the certificate key.
定义 hitls_cert_reg.h:223
HITLS_CERT_Key *(* CERT_KeyDupCallBack)(HITLS_CERT_Key *key)
Duplicate the certificate key.
定义 hitls_cert_reg.h:213
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
定义 hitls_cert_reg.h:255
int32_t(* CERT_StoreCtrlCallBack)(HITLS_Config *config, HITLS_CERT_Store *store, HITLS_CERT_CtrlCmd cmd, void *input, void *output)
ctrl interface
定义 hitls_cert_reg.h:75
HITLS_CERT_Store *(* CERT_StoreNewCallBack)(void)
Create a certificate store
定义 hitls_cert_reg.h:41
int32_t(* CERT_CheckPrivateKeyCallBack)(HITLS_Config *config, HITLS_CERT_X509 *cert, HITLS_CERT_Key *key)
Check whether the private key matches the certificate.
定义 hitls_cert_reg.h:318
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.
定义 hitls_cert_reg.h:305
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.
定义 hitls_cert_reg.h:123
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
定义 hitls_cert_reg.h:273
void(* CERT_StoreFreeCallBack)(HITLS_CERT_Store *store)
Release the certificate store.
定义 hitls_cert_reg.h:61
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.
定义 hitls_cert_reg.h:93
HITLS_CERT_X509 *(* CERT_CertParseCallBack)(HITLS_Config *config, const uint8_t *buf, uint32_t len, HITLS_ParseType type, HITLS_ParseFormat format)
Read the certificate.
定义 hitls_cert_reg.h:140
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.
定义 hitls_cert_reg.h:202
HITLS_CERT_MgrMethod * HITLS_CERT_GetMgrMethod(void)
Get certificate callback function
定义 cert_method.c:87
int32_t HITLS_CERT_RegisterMgrMethod(HITLS_CERT_MgrMethod *method)
Callback function related to certificate registration
定义 cert_method.c:62
CERT_CheckPrivateKeyCallBack HITLS_CFG_GetCheckPriKeyCb(HITLS_Config *config)
Interface for obtaining the registered private key and certificate matching check
HITLS_CERT_X509 *(* CERT_CertDupCallBack)(HITLS_CERT_X509 *cert)
Duplicate the certificate.
定义 hitls_cert_reg.h:151
void HITLS_CERT_DeinitMgrMethod(void)
Certificate deregistration callback function
定义 cert_method.c:76
HITLS_CERT_X509 *(* CERT_CertRefCallBack)(HITLS_CERT_X509 *cert)
Certificate reference counting plus one.
定义 hitls_cert_reg.h:161
int32_t(* CERT_KeyCtrlCallBack)(HITLS_Config *config, HITLS_CERT_Key *key, HITLS_CERT_CtrlCmd cmd, void *input, void *output)
Ctrl interface
定义 hitls_cert_reg.h:237
int32_t(* CERT_VerifyCertChainCallBack)(HITLS_Ctx *ctx, HITLS_CERT_Store *store, HITLS_CERT_X509 **certList, uint32_t num)
Verify the certificate chain
定义 hitls_cert_reg.h:108
int32_t(* CERT_CertCtrlCallBack)(HITLS_Config *config, HITLS_CERT_X509 *cert, HITLS_CERT_CtrlCmd cmd, void *input, void *output)
Ctrl interface
定义 hitls_cert_reg.h:185
void(* CERT_CertFreeCallBack)(HITLS_CERT_X509 *cert)
Release the certificate.
定义 hitls_cert_reg.h:171
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.
定义 hitls_cert_reg.h:289
HITLS_CERT_Store *(* CERT_StoreDupCallBack)(HITLS_CERT_Store *store)
Duplicate the certificate store.
定义 hitls_cert_reg.h:51
int32_t HITLS_CFG_SetCheckPriKeyCb(HITLS_Config *config, CERT_CheckPrivateKeyCallBack checkPrivateKey)
Register the private key with the config file and certificate matching Check Interface.
HITLS_ParseType
Read data format
定义 hitls_cert_type.h:129
void HITLS_CERT_Key
Describes the certificate key
定义 hitls_cert_type.h:49
HITLS_ParseFormat
Read data format
定义 hitls_cert_type.h:139
HITLS_CERT_CtrlCmd
ctrl option
定义 hitls_cert_type.h:85
void HITLS_CERT_Store
Describes the certificate
定义 hitls_cert_type.h:55
void HITLS_CERT_X509
Describes the x509 certificate
定义 hitls_cert_type.h:37
struct TlsCtx HITLS_Ctx
HITLS context
定义 hitls_type.h:35
struct TlsConfig HITLS_Config
config context
定义 hitls_type.h:41
Structure for certificate management methods
定义 hitls_cert_reg.h:324
CERT_StoreDupCallBack certStoreDup
定义 hitls_cert_reg.h:326
CERT_KeyDupCallBack keyDup
定义 hitls_cert_reg.h:340
CERT_VerifySignCallBack verifySign
定义 hitls_cert_reg.h:344
CERT_CreateSignCallBack createSign
定义 hitls_cert_reg.h:343
CERT_VerifyCertChainCallBack verifyCertChain
定义 hitls_cert_reg.h:330
CERT_EncryptCallBack encrypt
定义 hitls_cert_reg.h:345
CERT_BuildCertChainCallBack buildCertChain
定义 hitls_cert_reg.h:329
CERT_StoreNewCallBack certStoreNew
定义 hitls_cert_reg.h:325
CERT_CertCtrlCallBack certCtrl
定义 hitls_cert_reg.h:337
CERT_KeyParseCallBack keyParse
定义 hitls_cert_reg.h:339
CERT_DecryptCallBack decrypt
定义 hitls_cert_reg.h:346
CERT_KeyCtrlCallBack keyCtrl
定义 hitls_cert_reg.h:342
CERT_StoreCtrlCallBack certStoreCtrl
定义 hitls_cert_reg.h:328
CERT_CertParseCallBack certParse
定义 hitls_cert_reg.h:333
CERT_CheckPrivateKeyCallBack checkPrivateKey
定义 hitls_cert_reg.h:348
CERT_CertFreeCallBack certFree
定义 hitls_cert_reg.h:336
CERT_KeyFreeCallBack keyFree
定义 hitls_cert_reg.h:341
CERT_CertRefCallBack certRef
定义 hitls_cert_reg.h:335
CERT_StoreFreeCallBack certStoreFree
定义 hitls_cert_reg.h:327
CERT_CertDupCallBack certDup
定义 hitls_cert_reg.h:334
CERT_CertEncodeCallBack certEncode
定义 hitls_cert_reg.h:332