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

@210{
  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.
KeyId
uint32_t
Exported key Id.
ProtocolConfig
uint8_t
Key export protocol config.
SharedSecret[kMaxECDHSharedSecretSize]
uint8_t
SharedSecretLen
uint16_t
SignMessages
bool
Sign protocol messages flag.
State
enum nl::Weave::Profiles::Security::KeyExport::WeaveKeyExport::@210
The current state of the WeaveKeyExport object.

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)
Init(WeaveKeyExportDelegate *keyExportDelegate, GroupKeyStoreBase *groupKeyStore)
void
IsAllowedConfig(uint8_t config) const
bool
IsInitiator() const
bool
ProcessKeyExportReconfigure(const uint8_t *buf, uint16_t msgSize, uint8_t & config)
ProcessKeyExportRequest(const uint8_t *buf, uint16_t msgSize, const IPPacketInfo *pktInfo, const WeaveMessageInfo *msgInfo)
ProcessKeyExportResponse(const uint8_t *buf, uint16_t msgSize, const IPPacketInfo *pktInfo, const WeaveMessageInfo *msgInfo, uint8_t *exportedKeyBuf, uint16_t exportedKeyBufSize, uint16_t & exportedKeyLen, uint32_t & exportedKeyId)
Reset(void)
void
SetAllowedConfigs(uint8_t allowedConfigs)
void
Shutdown(void)
void

Public types

@210

 @210

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.

KeyId

uint32_t KeyId

Exported key Id.

ProtocolConfig

uint8_t ProtocolConfig

Key export protocol config.

SharedSecret

uint8_t SharedSecret[kMaxECDHSharedSecretSize]

SharedSecretLen

uint16_t SharedSecretLen

SignMessages

bool SignMessages

Sign protocol messages flag.

State

enum nl::Weave::Profiles::Security::KeyExport::WeaveKeyExport::@210 State

The current state of the WeaveKeyExport object.

[READ-ONLY] Current state of the WeaveKeyExport object.

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
)

Init

void Init(
  WeaveKeyExportDelegate *keyExportDelegate,
  GroupKeyStoreBase *groupKeyStore
)

IsAllowedConfig

bool IsAllowedConfig(
  uint8_t config
) const 

IsInitiator

bool IsInitiator() 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 IPPacketInfo *pktInfo,
  const WeaveMessageInfo *msgInfo
)

ProcessKeyExportResponse

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

Reset

void Reset(
  void
)

SetAllowedConfigs

void SetAllowedConfigs(
  uint8_t allowedConfigs
)

Shutdown

void Shutdown(
  void
)