API参考
载入中...
搜索中...
未找到
crypt_decoder_local.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 CRYPT_DECODER_LOCAL_H
17#define CRYPT_DECODER_LOCAL_H
18
19#include "hitls_build.h"
20#ifdef HITLS_CRYPTO_KEY_DECODE_CHAIN
21
22#include "bsl_types.h"
23#include "bsl_asn1.h"
24#include "crypt_types.h"
25#include "crypt_eal_pkey.h"
26
27#ifdef HITLS_CRYPTO_RSA
28#include "crypt_rsa.h"
29#endif
30#ifdef HITLS_CRYPTO_SM2
31#include "crypt_sm2.h"
32#endif
33#ifdef HITLS_CRYPTO_ED25519
34#include "crypt_curve25519.h"
35#endif
36
37#ifdef __cplusplus
38extern "C" {
39#endif /* __cpluscplus */
40
41#ifdef HITLS_CRYPTO_RSA
42int32_t CRYPT_RSA_ParsePubkeyAsn1Buff(void *libCtx, uint8_t *buff, uint32_t buffLen, BSL_ASN1_Buffer *param,
43 CRYPT_RSA_Ctx **rsaPubKey, BslCid cid);
44int32_t CRYPT_RSA_ParsePkcs8Key(void *libCtx, uint8_t *buff, uint32_t buffLen, CRYPT_RSA_Ctx **rsaPriKey);
45
46int32_t CRYPT_RSA_ParseSubPubkeyAsn1Buff(void *libCtx, uint8_t *buff, uint32_t buffLen, CRYPT_RSA_Ctx **pubKey,
47 bool isComplete);
48
49int32_t CRYPT_RSA_ParsePrikeyAsn1Buff(void *libCtx, uint8_t *buff, uint32_t buffLen, BSL_ASN1_Buffer *rsaPssParam,
50 CRYPT_RSA_Ctx **rsaPriKey);
51#endif
52
53#if defined(HITLS_CRYPTO_ECDSA) || defined(HITLS_CRYPTO_ECDH)
54int32_t CRYPT_ECC_ParseSubPubkeyAsn1Buff(void *libCtx, uint8_t *buff, uint32_t buffLen, void **pubKey, bool isComplete);
55
56int32_t CRYPT_ECC_ParsePkcs8Key(void *libCtx, uint8_t *buff, uint32_t buffLen, void **ecdsaPriKey);
57
58int32_t CRYPT_ECC_ParsePrikeyAsn1Buff(void *libCtx, uint8_t *buffer, uint32_t bufferLen, BSL_ASN1_Buffer *pk8AlgoParam,
59 void **ecPriKey);
60#endif
61
62#ifdef HITLS_CRYPTO_SM2
63int32_t CRYPT_SM2_ParseSubPubkeyAsn1Buff(void *libCtx, uint8_t *buff, uint32_t buffLen, CRYPT_SM2_Ctx **pubKey,
64 bool isComplete);
65int32_t CRYPT_SM2_ParsePrikeyAsn1Buff(void *libCtx, uint8_t *buffer, uint32_t bufferLen, BSL_ASN1_Buffer *pk8AlgoParam,
66 CRYPT_SM2_Ctx **sm2PriKey);
67int32_t CRYPT_SM2_ParsePkcs8Key(void *libCtx, uint8_t *buff, uint32_t buffLen, CRYPT_SM2_Ctx **sm2PriKey);
68#endif
69
70#ifdef HITLS_CRYPTO_ED25519
71int32_t CRYPT_ED25519_ParsePkcs8Key(void *libCtx, uint8_t *buffer, uint32_t bufferLen,
72 CRYPT_CURVE25519_Ctx **ed25519PriKey);
73int32_t CRYPT_ED25519_ParseSubPubkeyAsn1Buff(void *libCtx, uint8_t *buff, uint32_t buffLen,
74 CRYPT_CURVE25519_Ctx **pubKey, bool isComplete);
75#endif
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif // HITLS_CRYPTO_KEY_DECODE_CHAIN
82
83#endif // CRYPT_DECODER_LOCAL_H
BslCid
定义 bsl_obj.h:36