API参考
载入中...
搜索中...
未找到
hitls_pki_cert.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 */
15
16#ifndef HITLS_PKI_CERT_H
17#define HITLS_PKI_CERT_H
18
19#include "hitls_pki_types.h"
20#include "crypt_eal_pkey.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26typedef struct _HITLS_X509_Cert HITLS_X509_Cert;
27
34HITLS_X509_Cert *HITLS_X509_CertNew(void);
35
45HITLS_X509_Cert *HITLS_X509_ProviderCertNew(HITLS_PKI_LibCtx *libCtx, const char *attrName);
46
53void HITLS_X509_CertFree(HITLS_X509_Cert *cert);
54
63HITLS_X509_Cert *HITLS_X509_CertDup(HITLS_X509_Cert *src);
64
79int32_t HITLS_X509_CertSign(int32_t mdId, const CRYPT_EAL_PkeyCtx *prvKey, const HITLS_X509_SignAlgParam *algParam,
80 HITLS_X509_Cert *cert);
81
95int32_t HITLS_X509_CertDigest(HITLS_X509_Cert *cert, CRYPT_MD_AlgId mdId, uint8_t *data, uint32_t *dataLen);
96
108int32_t HITLS_X509_CertCtrl(HITLS_X509_Cert *cert, int32_t cmd, void *val, uint32_t valLen);
109
128int32_t HITLS_X509_CertParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_Cert **cert);
129
150int32_t HITLS_X509_ProviderCertParseBuff(HITLS_PKI_LibCtx *libCtx, const char *attrName, const char *format,
151 const BSL_Buffer *encode, HITLS_X509_Cert **cert);
152
170int32_t HITLS_X509_CertParseBundleBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_List **certlist);
171
192int32_t HITLS_X509_ProviderCertParseBundleBuff(HITLS_PKI_LibCtx *libCtx, const char *attrName, const char *format,
193 const BSL_Buffer *encode, HITLS_X509_List **certlist);
194
210int32_t HITLS_X509_CertParseFile(int32_t format, const char *path, HITLS_X509_Cert **cert);
211
230int32_t HITLS_X509_ProviderCertParseFile(HITLS_PKI_LibCtx *libCtx, const char *attrName, const char *format,
231 const char *path, HITLS_X509_Cert **cert);
232
248int32_t HITLS_X509_CertParseBundleFile(int32_t format, const char *path, HITLS_X509_List **certlist);
249
268int32_t HITLS_X509_ProviderCertParseBundleFile(HITLS_PKI_LibCtx *libCtx, const char *attrName, const char *format,
269 const char *path, HITLS_X509_List **certlist);
270
283int32_t HITLS_X509_CertGenBuff(int32_t format, HITLS_X509_Cert *cert, BSL_Buffer *buff);
284
297int32_t HITLS_X509_CertGenFile(int32_t format, HITLS_X509_Cert *cert, const char *path);
298
299#ifdef __cplusplus
300}
301#endif
302
303#endif // HITLS_PKI_CERT_H
CRYPT_MD_AlgId
定义 crypt_algid.h:68
struct EAL_PkeyCtx CRYPT_EAL_PkeyCtx
定义 crypt_eal_pkey.h:108
int32_t HITLS_X509_ProviderCertParseFile(HITLS_PKI_LibCtx *libCtx, const char *attrName, const char *format, const char *path, HITLS_X509_Cert **cert)
Parse a certificate file using the provider mechanism
int32_t HITLS_X509_CertParseFile(int32_t format, const char *path, HITLS_X509_Cert **cert)
Parse the CERT in the file.
HITLS_X509_Cert * HITLS_X509_ProviderCertNew(HITLS_PKI_LibCtx *libCtx, const char *attrName)
Create a new X509 certificate object using the provider mechanism
int32_t HITLS_X509_CertParseBundleBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_List **certlist)
Parse multiple certificates from a buffer.
int32_t HITLS_X509_CertCtrl(HITLS_X509_Cert *cert, int32_t cmd, void *val, uint32_t valLen)
Generic function to process certificate.
int32_t HITLS_X509_CertParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_Cert **cert)
Parse the CERT in the buffer.
int32_t HITLS_X509_CertGenFile(int32_t format, HITLS_X509_Cert *cert, const char *path)
Generate a certificate file.
int32_t HITLS_X509_ProviderCertParseBundleBuff(HITLS_PKI_LibCtx *libCtx, const char *attrName, const char *format, const BSL_Buffer *encode, HITLS_X509_List **certlist)
Parse multiple certificates from a buffer using the provider mechanism
void HITLS_X509_CertFree(HITLS_X509_Cert *cert)
Unallocate a certificate.
int32_t HITLS_X509_CertDigest(HITLS_X509_Cert *cert, CRYPT_MD_AlgId mdId, uint8_t *data, uint32_t *dataLen)
Compute the digest of the certificate.
int32_t HITLS_X509_CertParseBundleFile(int32_t format, const char *path, HITLS_X509_List **certlist)
Parse the CERTs in the file.
int32_t HITLS_X509_ProviderCertParseBuff(HITLS_PKI_LibCtx *libCtx, const char *attrName, const char *format, const BSL_Buffer *encode, HITLS_X509_Cert **cert)
Parse a certificate buffer using the provider mechanism
int32_t HITLS_X509_CertSign(int32_t mdId, const CRYPT_EAL_PkeyCtx *prvKey, const HITLS_X509_SignAlgParam *algParam, HITLS_X509_Cert *cert)
Sign a certificate.
HITLS_X509_Cert * HITLS_X509_CertNew(void)
Allocate a certificate.
int32_t HITLS_X509_CertGenBuff(int32_t format, HITLS_X509_Cert *cert, BSL_Buffer *buff)
Generates an encoded certificate.
int32_t HITLS_X509_ProviderCertParseBundleFile(HITLS_PKI_LibCtx *libCtx, const char *attrName, const char *format, const char *path, HITLS_X509_List **certlist)
Parse multiple certificates from a bundle file using the provider mechanism
HITLS_X509_Cert * HITLS_X509_CertDup(HITLS_X509_Cert *src)
Duplicate a certificate.
定义 bsl_types.h:40
Signature algorithm parameters.
定义 hitls_pki_types.h:215