Wax.CoseKey (wax_ v0.4.1) View Source

Link to this section Summary

Functions

Returns the list of supported algorithms

Verifies the signature of a message against a COSE key

Link to this section Types

Specs

cose_alg() :: integer()

Specs

t() :: %{required(integer()) => integer()}

Link to this section Functions

Specs

supported_algs() :: %{required(cose_alg()) => String.t()}

Returns the list of supported algorithms

iex> Wax.CoseKey.supported_algs()
%{
  -65535 => "RSASSA-PKCS1-v1_5 w/ SHA-1",
  -259 => "RS512 (TEMPORARY - registered 2018-04-19, expires 2019-04-19)",
  -258 => "RS384 (TEMPORARY - registered 2018-04-19, expires 2019-04-19)",
  -257 => "RS256 (TEMPORARY - registered 2018-04-19, expires 2019-04-19)",
  -42 => "RSAES-OAEP w/ SHA-512",
  -41 => "RSAES-OAEP w/ SHA-256",
  -39 => "PS512",
  -38 => "PS384",
  -37 => "PS256",
  -36 => "ES512",
  -35 => "ES384",
  -7 => "ES256"
}
Link to this function

verify(msg, cose_key, sig)

View Source

Specs

verify(message :: binary(), t(), signature :: binary()) ::
  :ok | {:error, atom()}

Verifies the signature of a message against a COSE key

Use supported_algs/0 to determine supported algorithms.