An Ed25519 public JSON Web Key used by Open Payments.
from_map/1 validates the shared schema's required fields and enum values.
An omitted use becomes nil; an explicit null is invalid. Additional JSON
metadata is preserved in extensions.
This public type rejects the private d parameter and excludes it from export,
including when a struct is manually modified. Its inspection omits extensions.
Private-key import belongs to the signing utilities.
Validation checks the schema's nonempty base64url alphabet for x. It does not
establish that the value decodes to a usable 32-byte Ed25519 key. Cryptographic
key validation and key selection are separate from decoding response data.
Struct literals can bypass validation. Call validate/1 after constructing or
modifying a struct; to_map/1 converts its shape without validating it.
Summary
Functions
Decodes and validates a public JWK JSON object.
Converts a public JWK to JSON fields, excluding private key material.
Validates a public JWK struct, treating nil use as omitted.
Types
Functions
@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}
Decodes and validates a public JWK JSON object.
Converts a public JWK to JSON fields, excluding private key material.
@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}
Validates a public JWK struct, treating nil use as omitted.