read

abstract fun read(tag: Tag, nfcKey: NfcKey): TravelDocument

Read travel document. First it executes appropriate access control method (BAC/PACE). Then it authenticates data and chip, and finally it returns travel document created from read Data Groups. This operation should be called on a background thread.

Return

Travel document data read from Data Groups stored on NFC chip.

Parameters

tag

Travel document NFC tag.

nfcKey

Travel document NFC key to establish access control. It is created from document number, date of birth and date of expiry.

Throws

If access to the chip data is denied either by PACE or BAC protocol.

If authentication of the chip using the Chip Authentication protocol fails. Secure connection was not established.

NfcTravelDocumentReaderException

If reading fails due to any other reason.


abstract fun read(tag: Tag, nfcKey: NfcKey, activeAuthenticationChallenge: ByteArray?): TravelDocument

Read travel document. First it executes appropriate access control method (BAC/PACE). Then it authenticates data and chip, and finally it returns travel document created from read Data Groups. This operation should be called on a background thread.

Return

Travel document data read from Data Groups stored on NFC chip.

Parameters

tag

Travel document NFC tag.

nfcKey

Travel document NFC key to establish access control. It is created from document number, date of birth and date of expiry.

activeAuthenticationChallenge

Random 8 bytes. If the Active Authentication challenge is set, Active Authentication protocol will be used for the authentication of the chip (if supported by the chip). Response (signature) will be returned in the TravelDocument data class. This response should be validated by the application server to verify the authenticity of the chip. In case when the Active Authentication protocol is not supported by the chip, the chip will be authenticated the same way as if the argument activeAuthenticationChallenge is not set.

Throws

If activeAuthenticationChallenge has invalid size.

If access to the chip data is denied either by PACE or BAC protocol.

If authentication of the chip using the Chip Authentication protocol fails. Secure connection was not established.

NfcTravelDocumentReaderException

If reading fails due to any other reason.


abstract fun read(tag: Tag, nfcKey: NfcKey, listeners: NfcTravelDocumentReader.Listeners)
abstract fun read(tag: Tag, nfcKey: NfcKey, activeAuthenticationChallenge: ByteArray?, listeners: NfcTravelDocumentReader.Listeners)