Exmbus.Parser.Afl.KeyInformationField (Exmbus v0.4.0)

View Source

AFL Key Information Field (KIF) as per EN 13757-7:2018

BitField NameDescription
15 to 8Key VersionThe Key Version identifies the applied key version, as specified in 7.7.1.
7 to 6RESReserved (0b0 by default)
5 to 4KDF-SelectionThe KDF-Selection identifies the applied Key Derivation Function, as specified in Table 25.
3 to 0Key IDThe Key ID identifies the applied key, as specified in Table 24.

In case of individual fragment authentication, the message key shall be applied for all fragments of the message. If the KI is not present, values of the configuration field in the TPL shall be used for the key selection.

Summary

Functions

Parses the Key Information Field (KI) from the AFL.

Encode the Key Information Field (KI) to binary.

Functions

decode(arg)

Parses the Key Information Field (KI) from the AFL.

Examples

iex> decode(<<0b00000000, 0b00000000>>)
{:ok, %Exmbus.Parser.Afl.KeyInformationField{
  key_version: 0,
  kdf_selection: 0,
  key_id: 0
}}

encode(arg1)

Encode the Key Information Field (KI) to binary.

Examples

iex> encode(%Exmbus.Parser.Afl.KeyInformationField{
...>   key_version: 0,
...>   kdf_selection: 0,
...>   key_id: 0
...> })
<<0x00, 0x00>>

iex> encode(nil)
<<>>

kdf(key_information_field)