read

abstract fun read(tag: Tag, password: Password, activeAuthenticationChallenge: ByteArray? = null): 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. Ongoing reading can be canceled by invoking the cancel method.

Return

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

Parameters

tag

Travel document NFC tag.

password

Password for accessing the chip.

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.

NotConnectedException

If NFC reading fails due to an NFC tag connection failure.

NfcTravelDocumentReaderException

If reading fails due to any other reason.


abstract fun read(tag: Tag, password: Password, activeAuthenticationChallenge: ByteArray? = null, listeners: NfcTravelDocumentReader.Listeners)

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. Ongoing reading can be canceled by invoking the cancel method.

Parameters

tag

Travel document NFC tag.

password

Password for accessing the chip.

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.

listeners

Status of the process will be reported to these listeners as well as the resulting travel document. For more information see Listeners.

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.

NotConnectedException

If NFC reading fails due to an NFC tag connection failure.

NfcTravelDocumentReaderException

If reading fails due to any other reason.


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

Deprecated

Use method `read(tag: Tag, password: Password, activeAuthenticationChallenge: ByteArray?)` instead.


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

Deprecated

Use method `read(tag: Tag, password: Password, activeAuthenticationChallenge: ByteArray?, listeners: Listeners)` instead.