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

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

Implements the core logic of the Weave key export protocol.

Summary

Public types

@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
}
enum
The current state of the WeaveKeyExport object.

Public attributes

ECDHPrivateKey[kMaxECDHPrivateKeySize]
uint8_t
ECDHPrivateKeyLen
uint16_t
ECDHPublicKey[kMaxECDHPublicKeySize]
uint8_t
EncryptionAndAuthenticationKey[kEncryptionAndAuthenticationKeySize]
uint8_t
GroupKeyStore
Pointer to a platform group key store object.
KeyExportDelegate
Pointer to a key export delegate object.
SharedSecret[kMaxECDHSharedSecretSize]
uint8_t
SharedSecretLen
uint16_t

Public functions

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

Public types

@260

 @260

The current state of the WeaveKeyExport object.

Properties
kState_InitiatorDone

Initiator state indicating that the key export response was processed.

kState_InitiatorGeneratingRequest

Initiator state indicating that the key export request message is being generated.

kState_InitiatorReconfigureProcessed

Initiator state indicating that the key export reconfigure message was processed.

kState_InitiatorRequestGenerated

Initiator state indicating that the key export request message has been generated.

kState_Reset

The initial (and final) state of a WeaveKeyExport object.

kState_ResponderDone

Responder state indicating that the key export response message was generated.

kState_ResponderProcessingRequest

Responder state indicating that the key export request message is being processed.

kState_ResponderRequestProcessed

Responder state indicating that the key export request message has been processed.

Public attributes

ECDHPrivateKey

uint8_t ECDHPrivateKey[kMaxECDHPrivateKeySize]

ECDHPrivateKeyLen

uint16_t ECDHPrivateKeyLen

ECDHPublicKey

uint8_t ECDHPublicKey[kMaxECDHPublicKeySize]

EncryptionAndAuthenticationKey

uint8_t EncryptionAndAuthenticationKey[kEncryptionAndAuthenticationKeySize]

GroupKeyStore

GroupKeyStoreBase * GroupKeyStore

Pointer to a platform group key store object.

KeyExportDelegate

WeaveKeyExportDelegate * KeyExportDelegate

Pointer to a key export delegate object.

SharedSecret

uint8_t SharedSecret[kMaxECDHSharedSecretSize]

SharedSecretLen

uint16_t SharedSecretLen

Public functions

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 

Reset

void Reset(
  void
)

SetAllowedConfigs

void SetAllowedConfigs(
  uint8_t allowedConfigs
)

Shutdown

void Shutdown(
  void
)

SignMessages

bool SignMessages() const 

State

uint8_t State() const