API参考
载入中...
搜索中...
未找到
session_enc.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 SESSION_ENC_H
17#define SESSION_ENC_H
18
19#include <stdint.h>
20#include "hitls_type.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
30typedef enum {
31 SESS_OBJ_VERSION = 0x0101,
32 SESS_OBJ_CIPHER_SUITE = 0x0102,
33 SESS_OBJ_MASTER_SECRET = 0x0103,
34 SESS_OBJ_PEER_CERT = 0x0104,
35 SESS_OBJ_START_TIME = 0x0106,
36 SESS_OBJ_TIMEOUT = 0x0107,
37 SESS_OBJ_HOST_NAME = 0x0108,
38 SESS_OBJ_SESSION_ID_CTX = 0x0109,
39 SESS_OBJ_SESSION_ID = 0x010A,
40 SESS_OBJ_SUPPORT_EXTEND_MASTER_SECRET = 0x010B,
41 SESS_OBJ_VERIFY_RESULT = 0x010C,
42 SESS_OBJ_AGE_ADD = 0x010D,
43} SessionObjType;
44
52uint32_t SESS_GetTotalEncodeSize(const HITLS_Session *sess);
53
65int32_t SESS_Encode(const HITLS_Session *sess, uint8_t *data, uint32_t length, uint32_t *usedLen);
66
77int32_t SESS_Decode(HITLS_Session *sess, const uint8_t *data, uint32_t length);
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif