AshOnetime.Signer behaviour (ash_onetime v0.2.0)

Copy Markdown View Source

Behaviour implemented by bounded token signers.

Summary

Types

algorithm()

@type algorithm() :: :hmac_sha256 | :ed25519

result(value)

@type result(value) :: {:ok, value} | {:error, AshOnetime.Error.t()}

Callbacks

algorithm()

@callback algorithm() :: algorithm()

sign(binary, term)

@callback sign(binary(), term()) :: result(binary())

verify(binary, binary, term)

@callback verify(binary(), binary(), term()) :: :ok | {:error, AshOnetime.Error.t()}