nl:: Weave:: Profiles:: Security:: AppKeys:: GroupKeyStoreBase
這是抽象類別。#include <src/lib/profiles/security/WeaveApplicationKeys.h>
Weave 群組鍵存放區類別的定義。
摘要
系統會呼叫這個類別中的函式,以便管理應用程式群組金鑰。
繼承
直接已知子類別:nl::Weave::DeviceLayer::Internal::GroupKeyStoreImpl
nl::Weave::DeviceLayer::Internal::GroupKeyStoreImpl
nl::Weave::DeviceLayer::Internal::GroupKeyStoreImplnl::Weave::Profiles::Security::AppKeys::DummyGroupKeyStore
受保護的屬性 |
|
---|---|
LastUsedEpochKeyId
|
uint32_t
|
NextEpochKeyStartTime
|
uint32_t
|
公用函式 |
|
---|---|
Clear(void)=0
|
virtual WEAVE_ERROR
|
DeleteGroupKey(uint32_t keyId)=0
|
virtual WEAVE_ERROR
|
DeleteGroupKeysOfAType(uint32_t keyType)=0
|
virtual WEAVE_ERROR
|
DeriveApplicationKey(uint32_t & appKeyId, const uint8_t *keySalt, uint8_t saltLen, const uint8_t *keyDiversifier, uint8_t diversifierLen, uint8_t *appKey, uint8_t keyBufSize, uint8_t keyLen, uint32_t & appGroupGlobalId)
|
衍生應用程式金鑰。
|
EnumerateGroupKeys(uint32_t keyType, uint32_t *keyIds, uint8_t keyIdsArraySize, uint8_t & keyCount)=0
|
virtual WEAVE_ERROR
|
GetCurrentAppKeyId(uint32_t keyId, uint32_t & curKeyId)
|
傳回目前的金鑰 ID。
|
GetCurrentUTCTime(uint32_t & utcTime)
|
virtual WEAVE_ERROR
取得目前平台 (世界標準時間) 時間 (以秒為單位)。
|
GetGroupKey(uint32_t keyId, WeaveGroupKey & groupKey)
|
取得應用程式群組金鑰。
|
RetrieveGroupKey(uint32_t keyId, WeaveGroupKey & key)=0
|
virtual WEAVE_ERROR
|
StoreGroupKey(const WeaveGroupKey & key)=0
|
virtual WEAVE_ERROR
|
受保護的函式 |
|
---|---|
Init(void)
|
void
初始化本機群組鍵儲存庫參數。
|
OnEpochKeysChange(void)
|
void
傳回目前的金鑰 ID。
|
RetrieveLastUsedEpochKeyId(void)=0
|
virtual WEAVE_ERROR
|
StoreLastUsedEpochKeyId(void)=0
|
virtual WEAVE_ERROR
|
受保護的屬性
LastUsedEpochKeyId
uint32_t LastUsedEpochKeyId
NextEpochKeyStartTime
uint32_t NextEpochKeyStartTime
公用函式
清除
virtual WEAVE_ERROR Clear( void )=0
DeleteGroupKey
virtual WEAVE_ERROR DeleteGroupKey( uint32_t keyId )=0
DeleteGroupKeysOfAType
virtual WEAVE_ERROR DeleteGroupKeysOfAType( uint32_t keyType )=0
DeriveApplicationKey
WEAVE_ERROR DeriveApplicationKey( uint32_t & appKeyId, const uint8_t *keySalt, uint8_t saltLen, const uint8_t *keyDiversifier, uint8_t diversifierLen, uint8_t *appKey, uint8_t keyBufSize, uint8_t keyLen, uint32_t & appGroupGlobalId )
衍生應用程式金鑰。
目前支援三種應用程式金鑰:目前的應用程式金鑰、輪替應用程式金鑰及靜態應用程式金鑰。要求目前的應用程式金鑰時,函式會根據目前的系統時間和每個訓練週期鍵的開始時間參數,尋找並使用目前的週期索引鍵。
詳細說明 | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||||||||
傳回值 |
|
EnumerateGroupKeys
virtual WEAVE_ERROR EnumerateGroupKeys( uint32_t keyType, uint32_t *keyIds, uint8_t keyIdsArraySize, uint8_t & keyCount )=0
GetCurrentAppKeyId
WEAVE_ERROR GetCurrentAppKeyId( uint32_t keyId, uint32_t & curKeyId )
傳回目前的金鑰 ID。
根據目前的系統時間和每個週期鍵的開始時間參數,找出目前的週期索引鍵。如果系統缺少有效且正確的時間,就會傳回上次使用的 Epoch 紀元金鑰 ID。
詳細說明 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
傳回值 |
|
GetCurrentUTCTime
virtual WEAVE_ERROR GetCurrentUTCTime( uint32_t & utcTime )
取得目前平台 (世界標準時間) 時間 (以秒為單位)。
詳細說明 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
傳回值 |
|
GetGroupKey
WEAVE_ERROR GetGroupKey( uint32_t keyId, WeaveGroupKey & groupKey )
取得應用程式群組金鑰。
這個函式可以衍生或擷取應用程式群組金鑰。這個函式支援的金鑰類型包括:架構密鑰、根金鑰、週期金鑰、群組主金鑰和中繼金鑰。
詳細說明 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
傳回值 |
|
RetrieveGroupKey
virtual WEAVE_ERROR RetrieveGroupKey( uint32_t keyId, WeaveGroupKey & key )=0
StoreGroupKey
virtual WEAVE_ERROR StoreGroupKey( const WeaveGroupKey & key )=0
受保護的函式
Init
void Init( void )
初始化本機群組鍵儲存庫參數。
OnEpochKeysChange
void OnEpochKeysChange( void )
傳回目前的金鑰 ID。
當應用程式訓練週期索引鍵發生任何變更 (刪除或儲存) 時,將 Epoch 紀元鍵相關聯的成員變數設為預設值。實作 StoreGroupKey()、DeleteGroupKey() 和 DeleteGroupKeysOfAType() 函式的子類別,才能呼叫這個方法。