AwsEncryptionSdk.Format.Footer (AWS Encryption SDK v1.0.0)

View Source

Message footer serialization and deserialization.

The footer contains an ECDSA signature that covers the entire message (header + body). It is only present when using algorithm suites that include digital signatures.

Format

| Field            | Size      |
|------------------|-----------|
| Signature Length | 2 bytes   | Uint16
| Signature        | Variable  | DER-encoded ECDSA signature

Signature Encoding

ECDSA signatures are DER-encoded per RFC 3279. The length varies:

  • P-256 (ECDSA_P256): typically 70-72 bytes
  • P-384 (ECDSA_P384): typically 102-104 bytes

Summary

Types

t()

Footer structure

Functions

Deserializes a footer from binary data.

Serializes a footer with the given signature.

Types

t()

@type t() :: %{signature: binary()}

Footer structure

Functions

deserialize(arg1)

@spec deserialize(binary()) :: {:ok, t(), binary()} | {:error, term()}

Deserializes a footer from binary data.

Returns {:ok, footer_map, rest} on success.

serialize(signature)

@spec serialize(binary()) :: {:ok, binary()}

Serializes a footer with the given signature.

Parameters

  • signature - DER-encoded ECDSA signature

Examples

iex> Footer.serialize(<<48, 69, 1, 2, 3>>)
{:ok, <<0, 5, 48, 69, 1, 2, 3>>}