API参考
载入中...
搜索中...
未找到
app_keymgmt.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_APP_KEYMGMT_H
17#define HITLS_APP_KEYMGMT_H
18#include <stdint.h>
19#include "app_sm.h"
20#include "crypt_eal_pkey.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25#ifdef HITLS_APP_SM_MODE
26#define HITLS_APP_MAX_KEY_LEN 64
27#define HITLS_APP_UUID_LEN 32
28
29typedef struct {
30 int32_t version;
31 uint8_t uuid[HITLS_APP_UUID_LEN];
32 int32_t algId;
33 int64_t createTime;
34 int64_t expireTime;
35} HITLS_APP_KeyAttr;
36
37typedef struct {
38 uint8_t key[HITLS_APP_MAX_KEY_LEN];
39 uint32_t keyLen;
40 CRYPT_EAL_PkeyCtx *pkeyCtx;
41 HITLS_APP_KeyAttr attr;
42} HITLS_APP_KeyInfo;
43
55typedef int32_t (*HITLS_APP_SendFunc)(void *ctx, const void *buf, uint32_t len);
56
68typedef int32_t (*HITLS_APP_RecvFunc)(void *ctx, void *buf, uint32_t len);
69
80int32_t HITLS_KeyMgmtMain(int argc, char *argv[]);
81
94int32_t HITLS_APP_FindKey(AppProvider *provider, HITLS_APP_SM_Param *smParam, int32_t algId,
95 HITLS_APP_KeyInfo *keyInfo);
96
109int32_t HITLS_APP_SendKey(AppProvider *provider, HITLS_APP_SM_Param *smParam, HITLS_APP_SendFunc sendFunc, void *ctx);
110
125int32_t HITLS_APP_ReceiveKey(AppProvider *provider, HITLS_APP_SM_Param *smParam, int32_t iter, int32_t saltLen,
126 HITLS_APP_RecvFunc recvFunc, void *ctx);
127#endif
128#ifdef __cplusplus
129}
130#endif
131#endif
struct EAL_PkeyCtx CRYPT_EAL_PkeyCtx
定义 crypt_eal_pkey.h:108
定义 app_provider.h:25