Attesto.CredentialOffer (Attesto v1.9.0)

Copy Markdown View Source

OID4VCI Credential Offer (draft-ietf-oauth-openid4vci §4.1).

Build the string-keyed Credential Offer object and its by-value or by-reference openid-credential-offer:// deep-link forms. This module is pure and conn-free; fetching a referenced offer is the wallet's concern.

Summary

Functions

Build an OID4VCI Credential Offer object.

Build a by-value openid-credential-offer:// deep link.

Build a by-reference openid-credential-offer:// deep link.

JSON-encode an offer for the credential_offer query parameter.

Functions

build(opts)

@spec build(keyword()) :: %{required(String.t()) => term()}

Build an OID4VCI Credential Offer object.

The required :credential_issuer and :credential_configuration_ids options are validated and normalized into a JSON-ready map. When supplied, :grants is normalized to the two OID4VCI grant types supported here: authorization_code and pre-authorized_code.

deep_link(offer, opts \\ [])

@spec deep_link(
  map(),
  keyword()
) :: String.t()

Build a by-value openid-credential-offer:// deep link.

to_query_value(offer)

@spec to_query_value(map()) :: String.t()

JSON-encode an offer for the credential_offer query parameter.