OpenId4VpWallet

class OpenId4VpWallet(engine: HttpClientEngine, httpClientConfig: HttpClientConfig<*>.() -> Unit? = null, keyMaterial: KeyMaterial, holderAgent: HolderAgent, randomSource: RandomSource = RandomSource.Secure, allowedDcApiOriginSchemes: suspend () -> Set<String> = { OpenId4VpHolder.DEFAULT_ALLOWED_DC_API_ORIGIN_SCHEMES })(source)

Implements the wallet side of Self-Issued OpenID Provider v2 and OpenID for Verifiable Presentations

Constructors

Link copied to clipboard
constructor(engine: HttpClientEngine, httpClientConfig: HttpClientConfig<*>.() -> Unit? = null, keyMaterial: KeyMaterial, holderAgent: HolderAgent, randomSource: RandomSource = RandomSource.Secure, allowedDcApiOriginSchemes: suspend () -> Set<String> = { OpenId4VpHolder.DEFAULT_ALLOWED_DC_API_ORIGIN_SCHEMES })

Types

Link copied to clipboard
Link copied to clipboard
sealed interface AuthenticationResult
Link copied to clipboard
Link copied to clipboard
class FormDataContentPlain(formData: Parameters) : OutgoingContent.ByteArrayContent

Our implementation of ktor's FormDataContent, but with contentType without charset appended, so that some strict mDoc verifiers accept our authn response

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

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). 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.

Link copied to clipboard
suspend fun finalizeDcApiResponse(state: DcApiPreparationState, credentialPresentation: CredentialPresentation? = null): KmmResult<DigitalCredentialInterface>

Finalizes state into a platform-independent Digital Credentials API response model.

Link copied to clipboard

Exceptions may be sent to the verifier in sendAuthnErrorResponse.

Matches credentials through the protocol handler captured by state.

Link copied to clipboard

Prepares either an OpenID4VP or Annex C request received through the Digital Credentials API.

Link copied to clipboard

Sends an error response with the appropriate method. Returns nothing as we don't expect a useful response from the remote verifier.

Link copied to clipboard

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). In case the result shall be sent as a redirect to the verifier, we return that URL.