Iso18013Presentment

suspend fun Iso18013Presentment(transport: MdocTransport, engagementParams: StateFlow<EngagementParams>, source: PresentmentSource, keyAgreementPossible: List<EcCurve>, preselectedDocuments: List<Document> = emptyList(), insertSequenceNumbers: Boolean = false, timeout: Duration? = 15.seconds, timeoutSubsequentRequests: Duration? = 30.seconds, onWaitingForRequest: () -> Unit = {}, onWaitingForUserInput: () -> Unit = {}, onDocumentsInFocus: (documents: List<Document>) -> Unit = {}, onSendingResponse: () -> Unit = {}, onDeviceRequest: (deviceRequest: DeviceRequest) -> Unit = {}, onTelemetry: (telemetry: PresentmentTelemetry) -> Unit = {})

Performs proximity presentment according to ISO/IEC 18013-5:2021.

Parameters

transport

the transport to use for communicating with the reader.

engagementParams

a StateFlow providing the current engagement parameters.

source

the source of truth for documents to present.

keyAgreementPossible

curves available for key agreement.

preselectedDocuments

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

insertSequenceNumbers

whether sequence numbers should be inserted in session messages.

timeout

timeout for initial message.

timeoutSubsequentRequests

timeout for subsequent messages.

onWaitingForRequest

callback when waiting for request.

onWaitingForUserInput

callback when waiting for user input.

onDocumentsInFocus

callback with selected documents.

onSendingResponse

callback when sending response.

onDeviceRequest

callback when a DeviceRequest is received.

onTelemetry

callback invoked with the final PresentmentTelemetry. This is guaranteed to be called both before returning normally and before an exception is thrown.

Throws

if user authentication failed or was canceled.

if face matching failed or was canceled.

if the user canceled in a consent prompt.

if it's not possible to satisfy the request.


suspend fun Iso18013Presentment(transport: MdocTransport, eDeviceKey: EcPrivateKey, deviceEngagement: DataItem, handover: DataItem, source: PresentmentSource, keyAgreementPossible: List<EcCurve>, preselectedDocuments: List<Document> = emptyList(), insertSequenceNumbers: Boolean = false, timeout: Duration? = 15.seconds, timeoutSubsequentRequests: Duration? = 30.seconds, onWaitingForRequest: () -> Unit = {}, onWaitingForUserInput: () -> Unit = {}, onDocumentsInFocus: (documents: List<Document>) -> Unit = {}, onSendingResponse: () -> Unit = {}, onTelemetry: (telemetry: PresentmentTelemetry) -> Unit = {})

Performs proximity presentment according to ISO/IEC 18013-5:2021 using individual engagement parameters.

Parameters

transport

the transport to use for communicating with the reader.

eDeviceKey

the ephemeral device key generated for engagement.

deviceEngagement

the encoded DeviceEngagement structure.

handover

the handover structure.

source

the source of truth for documents to present.

keyAgreementPossible

curves available for key agreement.

preselectedDocuments

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

insertSequenceNumbers

whether sequence numbers should be inserted in session messages.

timeout

timeout for initial message.

timeoutSubsequentRequests

timeout for subsequent messages.

onWaitingForRequest

callback when waiting for request.

onWaitingForUserInput

callback when waiting for user input.

onDocumentsInFocus

callback with selected documents.

onSendingResponse

callback when sending response.

onTelemetry

callback invoked with the final PresentmentTelemetry. This is guaranteed to be called both before returning normally and before an exception is thrown.

Throws

if user authentication failed or was canceled.

if face matching failed or was canceled.

if the user canceled in a consent prompt.

if it's not possible to satisfy the request.