mdocPresentmentObtainConsent

suspend fun mdocPresentmentObtainConsent(deviceRequest: DeviceRequest, source: PresentmentSource, keyAgreementPossible: List<EcCurve> = emptyList(), requesterAppId: String? = null, requesterOrigin: String? = null, preselectedDocuments: List<Document> = emptyList(), onWaitingForUserInput: () -> Unit = {}, onDocumentsInFocus: (documents: List<Document>) -> Unit = {}): CredentialSelection

Obtains user consent for ISO mdoc presentment according to ISO/IEC 18013-5:2021.

Return

a CredentialSelection containing the user's selection.

Parameters

deviceRequest

The device request.

source

the source of truth used for presentment.

keyAgreementPossible

the list of curves for which key agreement is possible.

requesterAppId

the appId if an app is making the request or null.

requesterOrigin

the origin or null.

preselectedDocuments

the list of documents the user may have preselected earlier or the empty list if the user didn't preselect.

onWaitingForUserInput

called when waiting for input from the user (consent or authentication)

onDocumentsInFocus

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.