-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMessageEncryptionKey.h
More file actions
55 lines (45 loc) · 1.23 KB
/
MessageEncryptionKey.h
File metadata and controls
55 lines (45 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* @Author : wilbur
* @Date : 2024-03-29 12:42:10
* @LastEditTime : 2024-03-29 21:12:48
* @LastEditors : wilbur
* @Description : Please enter file description
* Copyright (c) 2024, All Rights Reserved.
*/
/*
* Copyright (c) 2023 Project CHIP Authors.
*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file or at
* https://opensource.org/license/bsd-3-clause
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef MESSAGEENCRYPTIONKEY_H_
#define MESSAGEENCRYPTIONKEY_H_
class MessageEncryptionKey
{
public:
uint16_t keyId;
uint8_t sessionType;
char *dataEncKey;
guint dataEncKeyLen;
uint64_t srcNodeId;
MessageEncryptionKey *nextKey;
bool IsSameKey(const MessageEncryptionKey& otherKey) const;
};
enum {
kDataEncKeyLength_AES128CCM = 16
};
class MessageEncryptionKeyTable
{
public:
static void Init();
static const MessageEncryptionKey *FindKeysById(uint16_t keyId);
static const MessageEncryptionKey *AddKey(const MessageEncryptionKey& keyData);
private:
MessageEncryptionKeyTable(); // Not defined
~MessageEncryptionKeyTable(); // Not defined
static wmem_tree_t *sKeys;
};
#endif /* MESSAGEENCRYPTIONKEY_H_ */