nl::Weave::Profiles::Security::KeyExport::WeaveKeyExport

#include <src/lib/profiles/security/WeaveKeyExport.h>

实现 Weave 密钥导出协议的核心逻辑。

摘要

公共类型

@260{
  kState_Reset = 0,
  kState_InitiatorGeneratingRequest = 10,
  kState_InitiatorRequestGenerated = 11,
  kState_InitiatorReconfigureProcessed = 12,
  kState_InitiatorDone = 13,
  kState_ResponderProcessingRequest = 20,
  kState_ResponderRequestProcessed = 21,
  kState_ResponderDone = 22
}
枚举
WeaveKeyExport 对象的当前状态。

公共属性

ECDHPrivateKey[kMaxECDHPrivateKeySize]
uint8_t
ECDHPrivateKeyLen
uint16_t
ECDHPublicKey[kMaxECDHPublicKeySize]
uint8_t
EncryptionAndAuthenticationKey[kEncryptionAndAuthenticationKeySize]
uint8_t
GroupKeyStore
指向平台组密钥存储对象的指针。
KeyExportDelegate
指向密钥导出委托对象的指针。
SharedSecret[kMaxECDHSharedSecretSize]
uint8_t
SharedSecretLen
uint16_t

公共函数

AllowedConfigs() const
uint8_t
GenerateKeyExportReconfigure(uint8_t *buf, uint16_t bufSize, uint16_t & msgLen)
GenerateKeyExportRequest(uint8_t *buf, uint16_t bufSize, uint16_t & msgLen, uint8_t proposedConfig, uint32_t keyId, bool signMessages)
GenerateKeyExportResponse(uint8_t *buf, uint16_t bufSize, uint16_t & msgLen, const WeaveMessageInfo *msgInfo)
Init(WeaveKeyExportDelegate *keyExportDelegate, GroupKeyStoreBase *groupKeyStore)
void
IsAllowedConfig(uint8_t config) const
bool
IsInitiator() const
bool
KeyId() const
uint32_t
MessageInfo() const
ProcessKeyExportReconfigure(const uint8_t *buf, uint16_t msgSize, uint8_t & config)
ProcessKeyExportRequest(const uint8_t *buf, uint16_t msgSize, const WeaveMessageInfo *msgInfo)
ProcessKeyExportResponse(const uint8_t *buf, uint16_t msgSize, const WeaveMessageInfo *msgInfo, uint8_t *exportedKeyBuf, uint16_t exportedKeyBufSize, uint16_t & exportedKeyLen, uint32_t & exportedKeyId)
ProtocolConfig() const
uint8_t
Reset(void)
void
SetAllowedConfigs(uint8_t allowedConfigs)
void
Shutdown(void)
void
SignMessages() const
bool
State() const
uint8_t

公共类型

@260

 @260

WeaveKeyExport 对象的当前状态。

属性
kState_InitiatorDone

表明密钥导出响应已处理的启动器状态。

kState_InitiatorGeneratingRequest

用于指示正在生成密钥导出请求消息的启动器状态。

kState_InitiatorReconfigureProcessed

发起方状态,表示已处理密钥导出重新配置消息。

kState_InitiatorRequestGenerated

表明已生成密钥导出请求消息的启动器状态。

kState_Reset

WeaveKeyExport 对象的初始(和最终)状态。

kState_ResponderDone

表明已生成密钥导出响应消息的响应程序状态。

kState_ResponderProcessingRequest

响应方状态,表示密钥导出请求消息正在处理中。

kState_ResponderRequestProcessed

响应方状态,表示密钥导出请求消息已处理完毕。

公共属性

ECDHPrivateKey

uint8_t ECDHPrivateKey[kMaxECDHPrivateKeySize]

ECDHPrivateKeyLen

uint16_t ECDHPrivateKeyLen

ECDHPublicKey

uint8_t ECDHPublicKey[kMaxECDHPublicKeySize]

EncryptionAndAuthenticationKey

uint8_t EncryptionAndAuthenticationKey[kEncryptionAndAuthenticationKeySize]

GroupKeyStore

GroupKeyStoreBase * GroupKeyStore

指向平台组密钥存储对象的指针。

KeyExportDelegate

WeaveKeyExportDelegate * KeyExportDelegate

指向密钥导出委托对象的指针。

SharedSecret

uint8_t SharedSecret[kMaxECDHSharedSecretSize]

SharedSecretLen

uint16_t SharedSecretLen

公共函数

AllowedConfigs

uint8_t AllowedConfigs() const 

GenerateKeyExportReconfigure

WEAVE_ERROR GenerateKeyExportReconfigure(
  uint8_t *buf,
  uint16_t bufSize,
  uint16_t & msgLen
)

GenerateKeyExportRequest

WEAVE_ERROR GenerateKeyExportRequest(
  uint8_t *buf,
  uint16_t bufSize,
  uint16_t & msgLen,
  uint8_t proposedConfig,
  uint32_t keyId,
  bool signMessages
)

GenerateKeyExportResponse

WEAVE_ERROR GenerateKeyExportResponse(
  uint8_t *buf,
  uint16_t bufSize,
  uint16_t & msgLen,
  const WeaveMessageInfo *msgInfo
)

Init

void Init(
  WeaveKeyExportDelegate *keyExportDelegate,
  GroupKeyStoreBase *groupKeyStore
)

IsAllowedConfig

bool IsAllowedConfig(
  uint8_t config
) const 

IsInitiator

bool IsInitiator() const 

KeyId

uint32_t KeyId() const 

MessageInfo

const WeaveMessageInfo * MessageInfo() const 

ProcessKeyExportReconfigure

WEAVE_ERROR ProcessKeyExportReconfigure(
  const uint8_t *buf,
  uint16_t msgSize,
  uint8_t & config
)

ProcessKeyExportRequest

WEAVE_ERROR ProcessKeyExportRequest(
  const uint8_t *buf,
  uint16_t msgSize,
  const WeaveMessageInfo *msgInfo
)

ProcessKeyExportResponse

WEAVE_ERROR ProcessKeyExportResponse(
  const uint8_t *buf,
  uint16_t msgSize,
  const WeaveMessageInfo *msgInfo,
  uint8_t *exportedKeyBuf,
  uint16_t exportedKeyBufSize,
  uint16_t & exportedKeyLen,
  uint32_t & exportedKeyId
)

ProtocolConfig

uint8_t ProtocolConfig() const 

重置

void Reset(
  void
)

SetAllowedConfigs

void SetAllowedConfigs(
  uint8_t allowedConfigs
)

关停

void Shutdown(
  void
)

SignMessages

bool SignMessages() const 

uint8_t State() const