class KeyMaterial

Defined at line 528 of file ../../third_party/openthread/src/core/mac/mac_types.hpp

Represents a MAC Key Material.

Public Methods

void Clear ()

This method clears the `KeyMaterial`.

Under `OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE`, if the `KeyMaterial` currently stores a valid previous

`KeyRef`, the `Clear()` call will ensure to delete the previous `KeyRef` and set it to `kInvalidKeyRef`.

void KeyMaterial ()

Initializes a `KeyMaterial`.

Defined at line 534 of file ../../third_party/openthread/src/core/mac/mac_types.hpp

const Key & GetKey ()

Gets the literal `Key`.

Defined at line 572 of file ../../third_party/openthread/src/core/mac/mac_types.hpp

void SetFrom (const Key & aKey, bool aIsExportable)

Sets the `KeyMaterial` from a given Key.

If the `KeyMaterial` currently stores a valid `KeyRef`, the `SetFrom()` call will ensure to delete the previous

one before creating and using a new `KeyRef` associated with the new `Key`.

Parameters

aKey [in] A reference to the new key.
aIsExportable [in] Boolean indicating if the key is exportable (this is only applicable under `OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` config).
void ExtractKey (Key & aKey)

Extracts the literal key from `KeyMaterial`

Parameters

aKey [out] A reference to the output the key.
void ConvertToCryptoKey (Crypto::Key & aCryptoKey)

Converts `KeyMaterial` to a `Crypto::Key`.

Parameters

aCryptoKey [out] A reference to a `Crypto::Key` to populate.
bool operator== (const KeyMaterial & aOther)

Overloads operator `==` to evaluate whether or not two `KeyMaterial` instances are equal.

Parameters

aOther [in] The other `KeyMaterial` instance to compare with.