OpenId4VpProtocolClient
Implements the wallet side of OpenID for Verifiable Presentations 1.0, without sending any HTTP request itself: every call returns an HttpExchange, whose requests the caller sends with any HTTP stack. The KDoc of each method lists the ProtocolRequests its exchange sends.
The caller runs the exchanges of a presentation in order: prepareAuthorizationResponse for the request, then, after asking the user for consent, OpenId4VpHolder.finalizeAuthorizationResponse of openId4VpHolder, and sendAuthorizationResponse for a response to be posted to the verifier (response modes direct_post and direct_post.jwt). openId4VpHolder validates the requests, matches credentials, and creates the responses.
Requests that have already been parsed need no HTTP request to be prepared, so pass them to OpenId4VpHolder.startAuthorizationResponsePreparation directly, or, for requests received through the Digital Credentials API, to DcApiHolder.startAuthorizationResponsePreparation.
Properties
Functions
Parses input, i.e. a URL, the form-encoded parameters or a request object of an authorization request, and validates it with OpenId4VpHolder.startAuthorizationResponsePreparation of openId4VpHolder. Show the resulting state to the user, and resume with OpenId4VpHolder.finalizeAuthorizationResponse.
Parses input, loads the request object as prepareAuthorizationResponse does, and validates the request with OpenId4VpHolder.startAuthorizationResponsePreparation of openId4VpHolder under policy, returning its report next to the state. A rejected request still finishes the exchange with its report and state, so the wallet can show why, answer with an error response, or continue after the user decided to; the exchange fails only for transport errors and input that can not be parsed.
Posts response, an authorization response or authorization error response for the response modes direct_post and direct_post.jwt, to the verifier, as application/x-www-form-urlencoded without a charset parameter, which some strict mDoc verifiers reject.