ProximityPresentation

The holder's side of an ISO/IEC 18013-5 in-person presentation over BLE: show qrCode, and the reader that scans it connects, or advertises for the holder to connect, in one of the ProximityBLEModes the session offers. Follow state: on State.RequestReceived, ask the holder, then respond or decline. cancel ends it at any point. One request per session.

Types

Link copied to clipboard
data class Request(val reader: ProximityReaderIdentity, val documents: List<MdocPresentation.Document>)

The reader's request.

Link copied to clipboard
sealed interface State

Where the session is: follow state.

Properties

Link copied to clipboard

The QR code to show: "mdoc:" and the device engagement.

Link copied to clipboard

The session's state: State.WaitingForReader first, until one of the final states (State.isFinal).

Functions

Link copied to clipboard
fun cancel()

Ends the session now, from any state.

Link copied to clipboard
suspend fun decline()

Declines the request, or ends the session before one: the reader is told, and nothing is disclosed.

Link copied to clipboard
suspend fun respond(document: Int, credentialID: String, elements: List<MdocPresentation.Element>): Boolean

Presents the held mdoc credentialID for document number document, disclosing exactly elements, each one it requested, and sends the response, which ends the session. The holder key signs now, so a key store requiring the holder prompts. It returns whether the copy presented had been seen by another Verifier. On a WalletException nothing was sent and the request stands: try again, or decline.