MessageSignatures.KeyResolver behaviour (MessageSignatures v0.1.0)

Copy Markdown View Source

Resolves verification keys by keyid.

Key management, including JWKS fetching, caching, and rotation, is outside this package. The callback context carries %{label:, tag:, message:, params:} so resolvers can discriminate when key ids alone are ambiguous.

The resolved {algorithm, material}, not the message's alg parameter, decides the verification algorithm. An alg parameter is only cross-checked against the resolved algorithm.

Summary

Callbacks

resolve_verify_key(key_id, context)

@callback resolve_verify_key(key_id :: String.t() | nil, context :: map()) ::
  {:ok, {atom(), term()}} | {:error, term()}