OpenId4VpKtorHolder
Implements the wallet side of Self-Issued OpenID Provider v2 and OpenID for Verifiable Presentations with ktor, by sending the requests of OpenId4VpProtocolClient, which implements the protocol.
The parameters after httpClient are passed on to OpenId4VpHolder, see there.
Constructors
Types
Our implementation of ktor's FormDataContent, but with contentType without charset appended, so that some strict mDoc verifiers accept our authn response
Functions
Calls openId4VpHolder to finalize the authentication response. In case the result shall be POSTed to the verifier, we call client to do that, and return the redirect_uri of that POST (which the Wallet may open in a browser), see OpenId4VpProtocolClient.sendAuthorizationResponse. In case the result shall be sent as a redirect to the verifier, we return that URL. In case the result shall be returned via the Digital Credentials API, an AuthenticationForward will be returned with the result to be forwarded.
Finalizes state into a platform-independent Digital Credentials API response model.
Exceptions may be sent to the verifier in sendAuthnErrorResponse.
Matches credentials through the protocol handler captured by state.
Prepares either an OpenID4VP or Annex C request received through the Digital Credentials API.
Prepares either an OpenID4VP or Annex C request received through the Digital Credentials API under policy, returning its report next to the state, see DcApiHolder.startAuthorizationResponsePreparation: null only for an Annex C request without registration certificates. A rejected request is a successful result.
Sends an error response with the appropriate method. Returns nothing as we don't expect a useful response from the remote verifier.
Parses input, loads the request object, and validates the request, see OpenId4VpProtocolClient.prepareAuthorizationResponse.
Validates request under policy, returning its report next to the state, see OpenId4VpHolder.startAuthorizationResponsePreparation. A rejected request is a successful result with its report and state, so the wallet can show why, answer with sendAuthnErrorResponse, or continue after the user decided to. Its wallet_nonce is consumed, so validate a request once, with this method or the one without a policy, never with both.
Parses input, loads the request object, and validates the request under policy, returning its report next to the state, see OpenId4VpProtocolClient.prepareAuthorizationResponse. A rejected request is a successful result with its report and state; the result fails only for transport errors and input that can not be parsed. The wallet_nonce is consumed, so validate a request once, with this method or the one without a policy.
Calls openId4VpHolder to finalize the authentication response. In case the result shall be POSTed to the verifier, we call client to do that, and return the redirect_uri of that POST (which the Wallet may open in a browser), see OpenId4VpProtocolClient.sendAuthorizationResponse. In case the result shall be sent as a redirect to the verifier, we return that URL.