API参考
载入中...
搜索中...
未找到
hitls_pki_csr.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_CSR_H
17#define HITLS_PKI_CSR_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_Csr HITLS_X509_Csr;
27
34HITLS_X509_Csr *HITLS_X509_CsrNew(void);
35
45HITLS_X509_Csr *HITLS_X509_ProviderCsrNew(HITLS_PKI_LibCtx *libCtx, const char *attrName);
46
54void HITLS_X509_CsrFree(HITLS_X509_Csr *csr);
55
70int32_t HITLS_X509_CsrSign(int32_t mdId, const CRYPT_EAL_PkeyCtx *prvKey, const HITLS_X509_SignAlgParam *algParam,
71 HITLS_X509_Csr *csr);
72
85int32_t HITLS_X509_CsrGenBuff(int32_t format, HITLS_X509_Csr *csr, BSL_Buffer *buff);
86
99int32_t HITLS_X509_CsrGenFile(int32_t format, HITLS_X509_Csr *csr, const char *path);
100
112int32_t HITLS_X509_CsrCtrl(HITLS_X509_Csr *csr, int32_t cmd, void *val, uint32_t valLen);
113
130int32_t HITLS_X509_CsrParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_Csr **csr);
131
145int32_t HITLS_X509_CsrParseFile(int32_t format, const char *path, HITLS_X509_Csr **csr);
146
155int32_t HITLS_X509_CsrVerify(HITLS_X509_Csr *csr);
156
157#ifdef __cplusplus
158}
159#endif
160
161#endif // HITLS_PKI_CSR_H
struct EAL_PkeyCtx CRYPT_EAL_PkeyCtx
定义 crypt_eal_pkey.h:108
int32_t HITLS_X509_CsrParseBuff(int32_t format, const BSL_Buffer *encode, HITLS_X509_Csr **csr)
Parse the csr in the buffer.When the parameter is BSL_FORMAT_PEM and BSL_FORMAT_UNKNOWN,...
int32_t HITLS_X509_CsrVerify(HITLS_X509_Csr *csr)
Csr verify function
HITLS_X509_Csr * HITLS_X509_ProviderCsrNew(HITLS_PKI_LibCtx *libCtx, const char *attrName)
Create a new csr object using the provider mechanism
int32_t HITLS_X509_CsrGenBuff(int32_t format, HITLS_X509_Csr *csr, BSL_Buffer *buff)
Generate csr to store in buffer
HITLS_X509_Csr * HITLS_X509_CsrNew(void)
Allocate a pkcs10 csr.
int32_t HITLS_X509_CsrCtrl(HITLS_X509_Csr *csr, int32_t cmd, void *val, uint32_t valLen)
Generic function to process csr function
void HITLS_X509_CsrFree(HITLS_X509_Csr *csr)
Release the pkcs10 csr.
int32_t HITLS_X509_CsrSign(int32_t mdId, const CRYPT_EAL_PkeyCtx *prvKey, const HITLS_X509_SignAlgParam *algParam, HITLS_X509_Csr *csr)
Sign a CSR (Certificate Signing Request).
int32_t HITLS_X509_CsrParseFile(int32_t format, const char *path, HITLS_X509_Csr **csr)
Parse the csr in the file
int32_t HITLS_X509_CsrGenFile(int32_t format, HITLS_X509_Csr *csr, const char *path)
Generate csr to store in file
定义 bsl_types.h:40
Signature algorithm parameters.
定义 hitls_pki_types.h:215