-
Notifications
You must be signed in to change notification settings - Fork 14
/
MessageEncryptionKey.h
46 lines (36 loc) · 1009 Bytes
/
MessageEncryptionKey.h
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
/*
* 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;
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_ */