MdocNfcEngagementHelper

class MdocNfcEngagementHelper(val eDeviceKey: EcPublicKey, val onHandoverComplete: (connectionMethods: List<MdocConnectionMethod>, encodedDeviceEngagement: ByteString, handover: DataItem) -> Unit, val onError: (error: Throwable) -> Unit, val staticHandoverMethods: List<MdocConnectionMethod>? = null, val negotiatedHandoverPicker: (connectionMethods: List<MdocConnectionMethod>) -> MdocConnectionMethod? = null)

Helper used for NFC engagement on the mdoc side.

This implements NFC engagement according to ISO/IEC 18013-5:2021.

APDUs received from the NFC tag reader should be passed to the processApdu method.

Parameters

eDeviceKey

EDeviceKey as per ISO/IEC 18013-5:2021.

onHandoverComplete

the function to call when handover is complete.

onError

the function to call if an error occurs.

staticHandoverMethods

list of connection methods to offer the mdoc reader, must contain at least one element, or null to not use NFC static handover.

negotiatedHandoverPicker

a function to choose one of the connection methods from the mdoc reader or null to not use NFC negotiated handover.

Constructors

Link copied to clipboard
constructor(eDeviceKey: EcPublicKey, onHandoverComplete: (connectionMethods: List<MdocConnectionMethod>, encodedDeviceEngagement: ByteString, handover: DataItem) -> Unit, onError: (error: Throwable) -> Unit, staticHandoverMethods: List<MdocConnectionMethod>? = null, negotiatedHandoverPicker: (connectionMethods: List<MdocConnectionMethod>) -> MdocConnectionMethod? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val onError: (error: Throwable) -> Unit
Link copied to clipboard
val onHandoverComplete: (connectionMethods: List<MdocConnectionMethod>, encodedDeviceEngagement: ByteString, handover: DataItem) -> Unit
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun processApdu(command: CommandApdu): ResponseApdu

Process APDUs received from the remote NFC tag reader.