# inji/inji-openid4vp-ios-swift architecture

> Architecture diagram of the GitHub repository inji/inji-openid4vp-ios-swift, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/inji/inji-openid4vp-ios-swift
- Repository: https://github.com/inji/inji-openid4vp-ios-swift

## Overview

1. **Repository purpose**
   - This is a Swift Package implementing the OpenID for Verifiable Presentations (OpenID4VP) wallet-side flow.
   - It is not an app; it is a reusable library that validates verifier authorization requests, builds verifiable presentation responses, encrypts/signs where needed, and optionally posts results back to the verifier.

2. **Top-level façade**
   - `Sources/OpenID4VP/OpenID4VP.swift` is the main entry point.
   - The public API is centered around a wallet instance initialized with `traceabilityId` and optional `walletMetadata`.
   - All major flows hang off this façade: authenticate verifier, construct unsigned VP tokens, construct/send VP responses, and send error responses.

3. **Authorization request subsystem**
   - `AuthorizationRequest/` handles decoding and validation of incoming verifier requests.
   - It supports both request-by-value and request-by-reference (`request_uri`) and validates draft 21 vs draft 23 rules.
   - The request handler is split by `client_id_scheme` into concrete handlers for `did`, `pre-registered`, and `redirect_uri`, with a shared `ClientIdSchemeBasedAuthorizationRequestHandler` orchestrating selection.

4. **Verifier trust and client validation**
   - Trusted verifier configuration is represented by `dto/Verifier.swift`.
   - The request pipeline compares `client_id` and `response_uri` against the trusted verifier list, and optionally checks request signatures using the verifier’s `jwks_uri`.
   - This boundary is important in diagrams because it is the main trust gate before any presentation processing happens.

5. **Metadata and presentation-definition model**
   - `AuthorizationRequest/ClientMetadata` and `WalletMetadata.swift` model the capability exchange between wallet and verifier.
   - `PresentationDefinition/` contains the object model for input descriptors, constraints, fields, filters, and limit-disclosure semantics.
   - The library uses this metadata both to validate incoming requests and to shape what the wallet can advertise back to the verifier when `request_uri_method=post`.

6. **Authorization response construction**
   - `AuthorizationResponse/` turns selected credentials into a response payload aligned to the request’s response mode.
   - The response side has two main layers:
     - `VPToken/` builds concrete verifiable presentation tokens for supported formats.
     - `PresentationSubmission/` maps selected credentials back to the verifier’s input descriptors.
   - The output is either an unencrypted body with `vp_token` plus `presentation_submission`, or an encrypted wrapper containing the response payload.

7. **Unsigned token and signing workflow**
   - The library exposes two token construction paths:
     - `constructUnsignedVPToken` / `constructVPResponse` for the older, format-grouped flow.
     - `constructUnsignedVPTokenV2` / `constructVPResponseV2` for the newer flattened signing flow.
   - Format-specific implementations exist for `ldp_vc`, `mso_mdoc`, `sd_jwt`, and `vc+sd-jwt`.
   - This is a key architectural boundary: token construction is separate from wallet signing, so a wallet can sign externally and feed signatures back in.

8. **Format-specific token implementations**
   - Under `AuthorizationResponse/VPToken/types` and `UnsignedVPToken/types`, each credential family has its own token model and builder.
   - LDP VC uses proof/JWS-related structures, mdoc uses device-authentication data, and SD-JWT variants carry their own signing material.
   - These submodules are where credential-format differences are isolated from the generic OpenID4VP orchestration.

9. **Response modes and transport**
   - `ResponseModeHandler/` selects how the response is delivered based on `response_mode`.
   - Supported paths include `direct_post`, `direct_post.jwt`, and the `iar-post` variants described in the README.
   - The handlers decide whether the response is plain form-urlencoded content or an encrypted JWE payload before transport.

10. **Crypto and JWT layer**
   - `jwt/` contains the cryptographic primitives used by the response pipeline.
   - `JWS` handles signing-related JWT operations, while `JWE` handles encryption, including AES-GCM and ECDH-ES/X25519 key agreement support.
   - `KeyResolver/` resolves public keys from DID-based identifiers (`did:jwk`, `did:key`, `did:web`) for request verification and related cryptographic operations.

11. **Network boundary**
   - `NetworkManager/` is the only explicit outbound HTTP layer.
   - It is used for fetching `request_uri` content and for posting VP responses or error responses to the verifier’s `response_uri`.
   - This creates a clean boundary between protocol logic and transport concerns.

12. **Shared utilities and validation**
   - `Common/` holds reusable infrastructure: Base64url helpers, JSON encoding, CBOR utilities, nonce/UUID generation, field validation, and generic conversion helpers.
   - These utilities support both request parsing and response construction and keep low-level data handling out of the protocol-specific modules.

13. **Constants and error model**
   - `Constants/` centralizes protocol enums and identifiers such as client-id schemes, response modes, signature/encryption algorithms, and DID methods.
   - `Exceptions/` defines the library’s error taxonomy, and the README shows that errors are often mapped into verifier-facing error responses.
   - For diagrams, this is the control-plane layer that constrains and validates the whole flow.

14. **Tests and coverage**
   - `Tests/OpenID4VPTests/` mirrors the source structure closely, with dedicated tests for request handling, response mode selection, token builders, crypto utilities, key resolution, and network behavior.
   - The test layout reflects the architecture: each major subsystem is validated independently, which reinforces the library’s modular boundaries.

15. **End-to-end data flow**
   - The main flow is: verifier request enters the façade, request parsing/authentication validates trust and capabilities, selected credentials are transformed into unsigned VP token(s), wallet signing occurs, the signed result is packaged into a VP response, and the response is optionally POSTed to the verifier.
   - Error handling can branch off at multiple points, and the same network boundary is reused to notify the verifier of failures when possible.

Main entry points: [`Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequest.swift`](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequest.swift) (Auth Request), [`Sources/OpenID4VP/AuthorizationResponse/AuthorizationResponseHandler.swift`](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/AuthorizationResponseHandler.swift) (Response Handler), [`Sources/OpenID4VP/AuthorizationResponse/AuthorizationResponse.swift`](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/AuthorizationResponse.swift) (Auth Response), [`Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/ClientIdSchemeBasedAuthorizationRequestHandler.swift`](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/ClientIdSchemeBasedAuthorizationRequestHandler.swift) (Scheme Router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public_api["Public API"]
  node_openid4vp["OpenID4VP<br/>facade<br/>[OpenID4VP.swift]"]
end

subgraph group_auth_request["Authorization Request"]
  node_auth_request_main["Auth Request<br/>pipeline"]
  node_client_scheme_handler["Scheme Router<br/>orchestrator"]
  node_did_handler["DID Handler<br/>request handler"]
  node_pre_registered_handler["Pre-reg Handler<br/>request handler"]
  node_redirect_uri_handler["Redirect Handler<br/>request handler"]
  node_client_metadata["Client Metadata<br/>model"]
  node_wallet_metadata["Wallet Metadata<br/>model"]
  node_presentation_definition["Presentation Def<br/>model"]
end

subgraph group_auth_response["Authorization Response"]
  node_auth_response["Auth Response<br/>pipeline"]
  node_response_handler["Response Handler<br/>orchestrator"]
  node_presentation_submission["Presentation Submission<br/>mapping"]
  node_vp_token_factory["VP Token Factory"]
  node_unsigned_vp_token["Unsigned Tokens<br/>builder layer"]
  node_vp_signing_result["Signing Result<br/>adapter"]
end

subgraph group_crypto["Crypto & Keys"]
  node_jws_jwe["JWS / JWE<br/>crypto<br/>[JWEHandler.swift]"]
  node_key_resolver["Key Resolver"]
end

subgraph group_infra["Infrastructure"]
  node_verifier_dto["Verifier<br/>trust config<br/>[Verifier.swift]"]
  node_response_mode_handler["Response Mode<br/>router"]
  node_network_manager["Network<br/>transport"]
  node_common_utils["Common Utils<br/>utilities<br/>[Utils.swift]"]
  node_constants["Constants<br/>[ResponseMode.swift]"]
  node_errors["Errors<br/>error model"]
end

node_openid4vp -->|"authenticate request"| node_auth_request_main
node_openid4vp -->|"build response"| node_auth_response
node_openid4vp -->|"send error/response"| node_network_manager
node_auth_request_main -->|"dispatch"| node_client_scheme_handler
node_client_scheme_handler -->|"did"| node_did_handler
node_client_scheme_handler -->|"pre-registered"| node_pre_registered_handler
node_client_scheme_handler -->|"redirect_uri"| node_redirect_uri_handler
node_auth_request_main -->|"trust gate"| node_verifier_dto
node_auth_request_main -->|"read metadata"| node_client_metadata
node_auth_request_main -->|"parse definition"| node_presentation_definition
node_auth_request_main -->|"fetch request_uri"| node_network_manager
node_auth_request_main -->|"verify request sig"| node_jws_jwe
node_auth_response -->|"orchestrate"| node_response_handler
node_response_handler -->|"construct unsigned"| node_unsigned_vp_token
node_response_handler -->|"select format"| node_vp_token_factory
node_response_handler -->|"map selection"| node_presentation_submission
node_response_handler -->|"accept signature"| node_vp_signing_result
node_response_handler -->|"apply mode"| node_response_mode_handler
node_response_mode_handler -->|"post result"| node_network_manager
node_response_handler -->|"encrypt/sign"| node_jws_jwe
node_jws_jwe -->|"resolve keys"| node_key_resolver
node_auth_request_main -->|"validate/parse"| node_common_utils
node_auth_response -->|"encode/build"| node_common_utils
node_auth_request_main -->|"protocol rules"| node_constants
node_auth_response -->|"protocol rules"| node_constants
node_auth_request_main -->|"raise failures"| node_errors
node_auth_response -->|"emit failures"| node_errors

click node_openid4vp "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/OpenID4VP.swift"
click node_auth_request_main "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequest.swift"
click node_client_scheme_handler "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/ClientIdSchemeBasedAuthorizationRequestHandler.swift"
click node_did_handler "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/types/DidSchemeAuthorizationRequestHandler.swift"
click node_pre_registered_handler "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/types/PreRegisteredSchemeAuthorizationRequestHandler.swift"
click node_redirect_uri_handler "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/types/RedirectUriSchemeAuthorizationRequestHandler.swift"
click node_client_metadata "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/ClientMetadata/ClientMetadata.swift"
click node_wallet_metadata "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/WalletMetadata.swift"
click node_presentation_definition "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/PresentationDefinition/PresentationDefinition.swift"
click node_verifier_dto "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/dto/Verifier.swift"
click node_auth_response "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/AuthorizationResponse.swift"
click node_response_handler "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/AuthorizationResponseHandler.swift"
click node_presentation_submission "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/PresentationSubmission/PresentationSubmission.swift"
click node_vp_token_factory "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/VPToken/VPTokenFactory.swift"
click node_unsigned_vp_token "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/UnsignedVPToken/UnsignedVPToken.swift"
click node_vp_signing_result "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/VPTokenSigningResult/VpTokenSigningResult.swift"
click node_response_mode_handler "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/ResponseModeHandler/ResponseModeBasedHandler.swift"
click node_network_manager "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/NetworkManager/NetworkManager.swift"
click node_jws_jwe "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/jwt/JWE/JWEHandler.swift"
click node_key_resolver "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/jwt/KeyResolver/PublicKeyResolver.swift"
click node_common_utils "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/Common/Utils.swift"
click node_constants "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/Constants/ResponseMode.swift"
click node_errors "https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/Exceptions/OpenId4VPExceptions.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_openid4vp toneBlue
class node_auth_request_main,node_client_scheme_handler,node_did_handler,node_pre_registered_handler,node_redirect_uri_handler,node_client_metadata,node_wallet_metadata,node_presentation_definition toneAmber
class node_auth_response,node_response_handler,node_presentation_submission,node_vp_token_factory,node_unsigned_vp_token,node_vp_signing_result toneMint
class node_jws_jwe,node_key_resolver toneRose
class node_verifier_dto,node_response_mode_handler,node_network_manager,node_common_utils,node_constants,node_errors toneIndigo
```

## Components

### Public API

Wallet-facing entrypoints and shared protocol model

- [OpenID4VP](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/OpenID4VP.swift): facade · Main wallet-facing API for request handling and response construction · `Sources/OpenID4VP/OpenID4VP.swift`

### Authorization Request

Decode, validate, and trust incoming verifier requests

- [Auth Request](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequest.swift): pipeline · Entry point for parsing and validating verifier authorization requests · `Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequest.swift`
- [Scheme Router](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/ClientIdSchemeBasedAuthorizationRequestHandler.swift): orchestrator · Selects the client_id_scheme-specific request handler · `Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/ClientIdSchemeBasedAuthorizationRequestHandler.swift`
- [DID Handler](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/types/DidSchemeAuthorizationRequestHandler.swift): request handler · Validates did-based authorization requests · `Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/types/DidSchemeAuthorizationRequestHandler.swift`
- [Pre-reg Handler](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/types/PreRegisteredSchemeAuthorizationRequestHandler.swift): request handler · Validates pre-registered client requests · `Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/types/PreRegisteredSchemeAuthorizationRequestHandler.swift`
- [Redirect Handler](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/types/RedirectUriSchemeAuthorizationRequestHandler.swift): request handler · Validates redirect_uri-based authorization requests · `Sources/OpenID4VP/AuthorizationRequest/AuthorizationRequestHandler/types/RedirectUriSchemeAuthorizationRequestHandler.swift`
- [Client Metadata](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/ClientMetadata/ClientMetadata.swift): model · Verifier capability metadata exchanged during authorization · `Sources/OpenID4VP/AuthorizationRequest/ClientMetadata/ClientMetadata.swift`
- [Wallet Metadata](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/WalletMetadata.swift): model · Wallet capabilities advertised to the verifier · `Sources/OpenID4VP/AuthorizationRequest/WalletMetadata.swift`
- [Presentation Def](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationRequest/PresentationDefinition/PresentationDefinition.swift): model · Input descriptors, constraints, filters, and disclosure rules · `Sources/OpenID4VP/AuthorizationRequest/PresentationDefinition/PresentationDefinition.swift`

### Authorization Response

Build VP tokens, submissions, and response payloads

- [Auth Response](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/AuthorizationResponse.swift): pipeline · Builds VP response payloads and error responses · `Sources/OpenID4VP/AuthorizationResponse/AuthorizationResponse.swift`
- [Response Handler](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/AuthorizationResponseHandler.swift): orchestrator · Coordinates response payload assembly for the selected mode · `Sources/OpenID4VP/AuthorizationResponse/AuthorizationResponseHandler.swift`
- [Presentation Submission](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/PresentationSubmission/PresentationSubmission.swift): mapping · Maps selected credentials back to input descriptors · `Sources/OpenID4VP/AuthorizationResponse/PresentationSubmission/PresentationSubmission.swift`
- [VP Token Factory](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/VPToken/VPTokenFactory.swift): factory · Creates format-specific VP token builders and models · `Sources/OpenID4VP/AuthorizationResponse/VPToken/VPTokenFactory.swift`
- [Unsigned Tokens](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/UnsignedVPToken/UnsignedVPToken.swift): builder layer · Constructs unsigned VP token variants before wallet signing · `Sources/OpenID4VP/AuthorizationResponse/UnsignedVPToken/UnsignedVPToken.swift`
- [Signing Result](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/AuthorizationResponse/VPTokenSigningResult/VpTokenSigningResult.swift): adapter · Carries wallet-produced signatures into the response flow · `Sources/OpenID4VP/AuthorizationResponse/VPTokenSigningResult/VpTokenSigningResult.swift`

### Crypto & Keys

JWT, JWE, signing, encryption, and key resolution

- [JWS / JWE](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/jwt/JWE/JWEHandler.swift): crypto · Signing and encryption primitives used by response packaging · `Sources/OpenID4VP/jwt/JWE/JWEHandler.swift`
- [Key Resolver](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/jwt/KeyResolver/PublicKeyResolver.swift): resolver · Resolves public keys from DID-based identifiers · `Sources/OpenID4VP/jwt/KeyResolver/PublicKeyResolver.swift`

### Infrastructure

Networking, common utilities, constants, and errors

- [Verifier](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/dto/Verifier.swift): trust config · Trusted verifier configuration used as the trust gate · `Sources/OpenID4VP/dto/Verifier.swift`
- [Response Mode](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/ResponseModeHandler/ResponseModeBasedHandler.swift): router · Selects direct post and JWT response transport behavior · `Sources/OpenID4VP/ResponseModeHandler/ResponseModeBasedHandler.swift`
- [Network](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/NetworkManager/NetworkManager.swift): transport · Outbound HTTP for request_uri fetches and verifier posts · `Sources/OpenID4VP/NetworkManager/NetworkManager.swift`
- [Common Utils](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/Common/Utils.swift): utilities · Shared helpers for encoding, validation, nonce, UUID, and CBOR · `Sources/OpenID4VP/Common/Utils.swift`
- [Constants](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/Constants/ResponseMode.swift): protocol constants · Protocol enums and identifiers used across the library · `Sources/OpenID4VP/Constants/ResponseMode.swift`
- [Errors](https://github.com/inji/inji-openid4vp-ios-swift/blob/master/Sources/OpenID4VP/Exceptions/OpenId4VPExceptions.swift): error model · Library error taxonomy and protocol-facing failures · `Sources/OpenID4VP/Exceptions/OpenId4VPExceptions.swift`

## Connections

- OpenID4VP → Auth Request: authenticate request · The façade enters the verifier request pipeline
- OpenID4VP → Auth Response: build response · The façade exposes VP response construction
- OpenID4VP → Network: send error/response · The façade can post verifier-facing outcomes
- Auth Request → Scheme Router: dispatch · Routes by client_id_scheme
- Scheme Router → DID Handler: did · DID-based validation path
- Scheme Router → Pre-reg Handler: pre-registered · Trusted pre-registered client path
- Scheme Router → Redirect Handler: redirect_uri · Redirect URI client path
- Auth Request → Verifier: trust gate · Matches client_id and response_uri against trusted verifier config
- Auth Request → Client Metadata: read metadata · Consumes verifier metadata and request capabilities
- Auth Request → Presentation Def: parse definition · Validates requested presentation constraints
- Auth Request → Network: fetch request_uri · Retrieves request-by-reference content
- Auth Request → JWS / JWE: verify request sig · Uses JWT crypto to check signed requests when present
- Auth Response → Response Handler: orchestrate · Coordinates response assembly
- Response Handler → Unsigned Tokens: construct unsigned · Builds unsigned VP token payloads
- Response Handler → VP Token Factory: select format · Chooses the supported credential-format implementation
- Response Handler → Presentation Submission: map selection · Creates descriptor mapping for chosen credentials
- Response Handler → Signing Result: accept signature · Ingests wallet-produced signing material
- Response Handler → Response Mode: apply mode · Determines transport and wrapper form
- Response Mode → Network: post result · Sends direct_post and related verifier payloads
- Response Handler → JWS / JWE: encrypt/sign · Wraps the response when encryption or JWT packaging is required
- JWS / JWE → Key Resolver: resolve keys · Fetches DID-based public keys for crypto operations
- Auth Request → Common Utils: validate/parse · Shares decoding and low-level helpers
- Auth Response → Common Utils: encode/build · Uses shared utilities for payload construction
- Auth Request → Constants: protocol rules · Relies on protocol enums and identifiers
- Auth Response → Constants: protocol rules · Uses protocol enums and identifiers
- Auth Request → Errors: raise failures · Protocol validation failures map to the error taxonomy
- Auth Response → Errors: emit failures · Response construction and transport errors use the same taxonomy
