Class to get keys based on access level, and to check access levels.
Definition: cs_KeysAndAccess.h:19
OperationMode _operationMode
Cached operation mode.
Definition: cs_KeysAndAccess.h:93
uint8_t _setupKey[ENCRYPTION_KEY_LENGTH]
Current setup key.
Definition: cs_KeysAndAccess.h:103
void generateSetupKey()
Generate a new setup key.
void invalidateSetupKey()
Invalidate the setup key.
bool _encryptionEnabled
Cache of whether encryption is enabled.
Definition: cs_KeysAndAccess.h:98
void operator=(KeysAndAccess const &)
bool _setupKeyValid
Whether the setup key is valid.
Definition: cs_KeysAndAccess.h:108
static KeysAndAccess & getInstance()
Use static variant of singleton, no dynamic memory allocation.
Definition: cs_KeysAndAccess.h:22
bool getKey(EncryptionAccessLevel accessLevel, buffer_ptr_t outBuf, cs_buffer_size_t outBufSize)
Get key of given access level.
KeysAndAccess(KeysAndAccess const &)
cs_ret_code_t setSetupKey(cs_data_t data)
Set the setup key.
void init()
Init the class: reads from State.
bool allowAccess(EncryptionAccessLevel minimum, EncryptionAccessLevel provided)
Verify if the access level provided is sufficient.
cs_data_t getSetupKey()
Get a pointer to the setup key.
#define ENCRYPTION_KEY_LENGTH
Definition: cs_Config.h:162
EncryptionAccessLevel
Packets (structs) that are used over the air, over uart, or stored in flash.
Definition: cs_Packets.h:36
uint16_t cs_buffer_size_t
Definition: cs_Typedefs.h:20
uint16_t cs_ret_code_t
Definition: cs_Typedefs.h:21
uint8_t * buffer_ptr_t
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: 10 May....
Definition: cs_Typedefs.h:19
OperationMode
Definition: cs_Types.h:440
Packets (structs) that are used internally in the firmware, and can be changed freely.
Definition: cs_PacketsInternal.h:27