NfcEngagementHelper

Helper used for NFC engagement.

This implements NFC engagement as defined in ISO/IEC 18013-5:2021.

Applications can instantiate a NfcEngagementHelper using NfcEngagementHelper.Builder to specify the NFC engagement type (static or negotiated) and other details, such as which device retrieval methods to offer with static handover.

If negotiated handover is used, Listener.onTwoWayEngagementDetected is called when the NFC tag reader has selected the connection handover service.

When a remote mdoc reader connects to either one of the transports advertised via static handover or one of the transports offered by the reader via negotiated handover, Listener.onDeviceConnected is called and the application can use the passed-in DataTransport to create a com.android.identity.android.mdoc.deviceretrieval.DeviceRetrievalHelper to start the transaction.

Types

Link copied to clipboard
class Builder(context: Context, eDeviceKey: EcPublicKey, options: DataTransportOptions, listener: NfcEngagementHelper.Listener, executor: Executor)

A builder for NfcEngagementHelper.

Link copied to clipboard
object Companion
Link copied to clipboard
interface Listener

Listener for NfcEngagementHelper.

Properties

Link copied to clipboard

Gets the bytes of the DeviceEngagement CBOR.

Link copied to clipboard
lateinit var handover: ByteArray

Gets the bytes of the Handover CBOR.

Functions

Link copied to clipboard
fun close()

Close all transports currently being listened on.

Link copied to clipboard
fun nfcOnDeactivated(reason: Int)

Method to call when link has been lost or if a different NFC AID has been selected.

Link copied to clipboard

Method to call when a command APDU has been received.

Link copied to clipboard
Link copied to clipboard