Presentation

Answers one OpenID4VP request: show verifier, queries and credentialSets, choose a selection (or start from defaultSelection), preview it, then respond or decline. The wallet presents exactly the selection, after checking it answers the request (WalletException.Code.invalidSelection otherwise).

Types

Link copied to clipboard
@Serializable
data class CredentialSet(val options: List<List<String>>, val required: Boolean = true)

One of the request's sets of alternatives: each option is the query IDs that together answer it, most preferred first. A required set must be answered by one option.

Link copied to clipboard
@Serializable
data class Disclosure(val queryID: String, val credentialID: String, val claims: List<List<PathElement>>, val alwaysDisclosed: List<List<PathElement>> = emptyList(), val retained: List<List<PathElement>> = emptyList())

What a selection would disclose from one credential.

Link copied to clipboard
@Serializable
data class Presented(val queryIDs: List<String> = emptyList(), val redirectURI: String? = null, val dcapiResponse: String? = null)

What responding or declining sent.

Link copied to clipboard
@Serializable
data class Query(val queryID: String, val multiple: Boolean = false, val credentials: List<CredentialSummary> = emptyList(), val unregistered: List<List<PathElement>> = emptyList(), val unregisteredAll: Boolean = false)

One of the request's credential queries, with the credentials that can answer it: none when nothing held can.

Link copied to clipboard
@Serializable
data class Registration(val status: Presentation.Registration.Status, val name: String? = null, val purpose: String? = null, val privacyPolicy: String? = null, val registrar: String? = null, val claims: List<List<PathElement>> = emptyList(), val expires: Instant? = null)

A Verifier's registration with a registrar: who it is and what it may request, as the registrar attests.

Link copied to clipboard
@Serializable
data class Verifier(val clientID: String = "", val name: String = "", val responseURI: String = "", val registration: Presentation.Registration, val origin: String? = null)

Who is asking.

Properties

Link copied to clipboard

The request's sets of alternatives; none means every query must be answered.

Link copied to clipboard

Whether some credential can answer some query: if not, decline.

Link copied to clipboard

The request's credential queries, in its order.

Link copied to clipboard

Who is asking.

Functions

Link copied to clipboard

Tells the Verifier the holder declined.

Link copied to clipboard

The selection the wallet would make itself, for an app with no policy of its own, or to start from: the first answerable option of each credential set, and each query's first credential (all of them when it takes several). Throws noMatchingCredential when the request can't be answered.

Link copied to clipboard
suspend fun preview(selection: Selection): List<Presentation.Disclosure>

What responding with selection would disclose, without signing or sending anything.

Link copied to clipboard
suspend fun respond(selection: Selection): Presentation.Presented

Presents exactly selection: holder keys sign now, so a key store requiring the holder prompts.