AttestoPhoenix.Verifier (AttestoPhoenix v2.7.0)

Copy Markdown View Source

Host-facing OID4VP verifier API.

Presentation requests are persisted before their signed request object is published. Wallet responses are verified by the public direct-post controller, and hosts poll the completed result through presentation_result/2.

Request objects continue to use the main Config.keystore/1; their protected alg is derived from that key by Attesto.JWS.sign_current/3. The separate verifier-encryption keystore is only an ECDH-ES recipient key and never changes request-object signing policy.

Summary

Functions

Create a verifier presentation session and its signed request object.

Read the verified result of a completed presentation session.

Types

create_attrs()

@type create_attrs() :: %{
  :dcql_query => map(),
  :expected_query_ids => [String.t()],
  :issuer_trust => Attesto.PresentationSession.issuer_trust(),
  optional(:response_mode) => String.t(),
  optional(:client_id_scheme) => String.t()
}

create_result()

@type create_result() :: %{
  id: String.t(),
  nonce: String.t(),
  client_id: String.t(),
  request_uri: String.t()
}

Functions

create_presentation_request(config, attrs)

@spec create_presentation_request(AttestoPhoenix.Config.t(), create_attrs()) ::
  {:ok, create_result()} | {:error, term()}

Create a verifier presentation session and its signed request object.

The returned id is the OID4VP state; the absolute request_uri serves the request object from the convention-derived verifier endpoint.

presentation_result(config, id)

@spec presentation_result(AttestoPhoenix.Config.t(), String.t()) ::
  {:ok, map()} | :error

Read the verified result of a completed presentation session.