mdocPresentment
Present ISO mdoc credentials according to ISO/IEC 18013-5:2021.
If the application needs to separate obtaining consent, user authentication, and response generation (for example, arming the wallet so the user can deliver the response via an NFC tap later), it can use mdocPresentmentObtainConsent, mdocPresentmentAuthenticateUser, and mdocPresentmentGenerateResponse directly:
// Step 1: Obtain consent from user
val selection = mdocPresentmentObtainConsent(deviceRequest, source, ...)
// Step 2: Perform user authentication and obtain key unlock data
val keyUnlockDataProvider = mdocPresentmentAuthenticateUser(selection)
// Step 3: Later (e.g. upon NFC tap), generate response using preloaded key unlock data
val response = withContext(keyUnlockDataProvider) {
mdocPresentmentGenerateResponse(selection, deviceRequest, eReaderKey, sessionTranscript, source, ...)
}Return
a Iso18013Response containing DeviceResponse and EventPresentmentData.
Parameters
The device request.
The ephemeral reader key, if available.
the session transcript.
the source of truth used for presentment.
the list of curves for which key agreement is possible.
the appId if an app is making the request or null.
the origin or null.
the time to use for creationTime when presenting credentials such as SD-JWT+KB VCs.
the list of documents the user may have preselected earlier (for example an OS-provided credential picker like Android's Credential Manager) or the empty list if the user didn't preselect.
called when waiting for input from the user (consent or authentication)
called with the documents currently selected for the user, including when first shown. If the user selects a different set of documents in the prompt, this will be called again.
Throws
if the user canceled in a consent prompt.
if it's not possible to satisfy the request.