DirectAccess

@RequiresApi(value = 28)
object DirectAccess

A class which handles common operations related to the DirectAccess applet.

Properties

Link copied to clipboard

Returns true if direct access is supported on the device, false otherwise.

Link copied to clipboard

Returns the maximum size, in bytes, of credentialData which can be used in credentials.

Link copied to clipboard

Functions

Link copied to clipboard

Allocates space (a slot) in the Direct Access applet for a document to be provisioned to.

Link copied to clipboard
fun certifyCredential(documentSlot: Int, credentialData: ByteArray, encryptedPresentationData: ByteArray): ByteArray

Certifies the credential with the given encryptedPresentationData and returns the updated encryptedPresentationData.

Link copied to clipboard
fun clearCredentialUsageCount(documentSlot: Int)

Resets the usage count of the credential in the slot to 0.

Link copied to clipboard
fun clearDocumentSlot(documentSlot: Int): Boolean

Clears a slot.

Link copied to clipboard

Creates a credential at the given slot.

Link copied to clipboard

Enumerates slots which have already been allocated.

Link copied to clipboard
fun getCredentialUsageCount(documentSlot: Int): Int

Returns the number of times the credential in the slot has been used in a presentation since it was set as the active credential or since the usage count was reset with clearCredentialUsageCount.

Link copied to clipboard
fun setActiveCredential(documentSlot: Int, encryptedPresentationData: ByteArray?)

Sets the credential represented by the encryptedPresentationData as the active credential in the slot (ie. it would be the one used during presentation). If encryptedPresentationData is null, clears active credential.

Link copied to clipboard

Use this function to ensure the transport is initialized (since Kotlin singletons are initialized on first access) so that the app can begin connecting to the applet in the background.