OpenPayments.Types.JWKS (open_payments_elixir v1.0.0)

Copy Markdown View Source

A public JSON Web Key Set returned by a wallet address server.

The shared schema requires a keys array and forbids other top-level fields. Each entry is decoded to an OpenPayments.Types.JWK. Empty arrays and repeated key IDs are permitted by the schema; selecting a usable key is a separate step. Validation errors include array indexes, such as keys[0].x.

Struct literals can bypass validation. Call validate/1 after constructing or modifying a struct; to_map/1 only converts its shape.

Summary

Functions

Decodes and validates a public JWKS JSON object.

Converts a public JWKS to its JSON representation without validating it.

Validates a JWKS struct and every contained JWK struct.

Types

t()

@type t() :: %OpenPayments.Types.JWKS{keys: [OpenPayments.Types.JWK.t()]}

Functions

from_map(data)

@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}

Decodes and validates a public JWKS JSON object.

to_map(jwks)

@spec to_map(t()) :: map()

Converts a public JWKS to its JSON representation without validating it.

validate(jwks)

@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}

Validates a JWKS struct and every contained JWK struct.