API参考
载入中...
搜索中...
未找到
hitls_pki_x509.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_X509_H
17#define HITLS_PKI_X509_H
18
19#include "hitls_pki_cert.h"
20#include "hitls_pki_crl.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26typedef struct _HITLS_X509_StoreCtx HITLS_X509_StoreCtx;
27
39typedef int32_t (*X509_STORECTX_VerifyCb)(int32_t, HITLS_X509_StoreCtx *);
40
47HITLS_X509_StoreCtx *HITLS_X509_StoreCtxNew(void);
48
58HITLS_X509_StoreCtx *HITLS_X509_ProviderStoreCtxNew(HITLS_PKI_LibCtx *libCtx, const char *attrName);
59
67void HITLS_X509_StoreCtxFree(HITLS_X509_StoreCtx *storeCtx);
68
105int32_t HITLS_X509_StoreCtxCtrl(HITLS_X509_StoreCtx *storeCtx, int32_t cmd, void *val, uint32_t valLen);
106
116int32_t HITLS_X509_CertVerify(HITLS_X509_StoreCtx *storeCtx, HITLS_X509_List *chain);
117
127int32_t HITLS_X509_CertVerifyByPubKey(HITLS_X509_Cert *cert, CRYPT_EAL_PkeyCtx *pubKey);
128
141int32_t HITLS_X509_CertChainBuild(HITLS_X509_StoreCtx *storeCtx, bool isWithRoot, HITLS_X509_Cert *cert,
142 HITLS_X509_List **chain);
143
163int32_t HITLS_X509_VerifyHostname(HITLS_X509_Cert *cert, uint32_t flags, const char *hostname, uint32_t hostnameLen);
164
181int32_t HITLS_X509_CheckKey(HITLS_X509_Cert *cert, CRYPT_EAL_PkeyCtx *prvKey);
182
183#ifdef __cplusplus
184}
185#endif
186
187#endif // HITLS_PKI_X509_H
struct EAL_PkeyCtx CRYPT_EAL_PkeyCtx
定义 crypt_eal_pkey.h:108
void HITLS_X509_StoreCtxFree(HITLS_X509_StoreCtx *storeCtx)
Release the StoreCtx.
HITLS_X509_StoreCtx * HITLS_X509_ProviderStoreCtxNew(HITLS_PKI_LibCtx *libCtx, const char *attrName)
Create a new X509 store object using the provider mechanism
int32_t HITLS_X509_CertVerifyByPubKey(HITLS_X509_Cert *cert, CRYPT_EAL_PkeyCtx *pubKey)
Verify a single certificate's signature using an external public key.
int32_t HITLS_X509_StoreCtxCtrl(HITLS_X509_StoreCtx *storeCtx, int32_t cmd, void *val, uint32_t valLen)
Generic function to process StoreCtx.
int32_t HITLS_X509_CertVerify(HITLS_X509_StoreCtx *storeCtx, HITLS_X509_List *chain)
Certificate chain verify function.
int32_t HITLS_X509_CertChainBuild(HITLS_X509_StoreCtx *storeCtx, bool isWithRoot, HITLS_X509_Cert *cert, HITLS_X509_List **chain)
Certificate chain build function.
int32_t(* X509_STORECTX_VerifyCb)(int32_t, HITLS_X509_StoreCtx *)
Certificate chain build function.
定义 hitls_pki_x509.h:39
HITLS_X509_StoreCtx * HITLS_X509_StoreCtxNew(void)
Allocate a StoreCtx.
int32_t HITLS_X509_CheckKey(HITLS_X509_Cert *cert, CRYPT_EAL_PkeyCtx *prvKey)
Verify that a certificate's public key matches a given private key.
int32_t HITLS_X509_VerifyHostname(HITLS_X509_Cert *cert, uint32_t flags, const char *hostname, uint32_t hostnameLen)
Verifies a certificate's hostname according to RFC6125 and RFC9525. It first checks for a matching dN...