Class EmrtdConnector
-
- All Implemented Interfaces:
public class EmrtdConnector
Connect an eMRTD NFC Chip with the Document Validation Server.
Will connect to the NFC Chip using an android.nfc.tech.IsoDep. Will connect to the Document Validation Server using a org.java_websocket.client.WebSocketClient.
-
-
Field Summary
Fields Modifier and Type Field Description public Exception
nfcException
public Exception
webSocketClientException
-
Constructor Summary
Constructors Constructor Description EmrtdConnector(String clientId, String webSocketUrl, ClosedListener closedListener, StatusListener statusListener, EmrtdPassportListener emrtdPassportListener)
-
Method Summary
Modifier and Type Method Description Exception
getNfcException()
Exception
getWebSocketClientException()
void
connect(IsoDep isoDep, String validationId, String can)
Starts the Session. void
connect(IsoDep isoDep, String validationId, String documentNumber, String dateOfBirth, String dateOfExpiry)
Starts the Session. void
cancel()
Cancels this session as soon as possible. boolean
isOpen()
-
-
Constructor Detail
-
EmrtdConnector
EmrtdConnector(String clientId, String webSocketUrl, ClosedListener closedListener, StatusListener statusListener, EmrtdPassportListener emrtdPassportListener)
- Parameters:
clientId
- Client IdwebSocketUrl
- Url of the WebSocket endpointclosedListener
- will be called when the WebSocket connection is closed.statusListener
- will be called every time the Server provides anupdate about the current status.Can be null if user of EmrtdConnector is not interestedin status updates.emrtdPassportListener
- will be called when the Server returns the result.Can be null if the user of EmrtdConnector is not interestedin the Result.
-
-
Method Detail
-
getNfcException
Exception getNfcException()
-
getWebSocketClientException
Exception getWebSocketClientException()
-
connect
void connect(IsoDep isoDep, String validationId, String can)
Starts the Session.
The `can` functions as the AccessKey and is required to access the chip.
- Parameters:
isoDep
- IsoDep of an ICAO-9303 NFC TagvalidationId
- Unique String to identify this session.can
- CAN, a 6 digit number, printed on the front of the document.
-
connect
void connect(IsoDep isoDep, String validationId, String documentNumber, String dateOfBirth, String dateOfExpiry)
Starts the Session.
The `documentNumber`, `dateOfBirth`, `dateOfExpiry` function as the AccessKey, required to access the chip.
- Parameters:
isoDep
- IsoDep of an ICAO-9303 NFC TagvalidationId
- Unique String to identify this session.documentNumber
- Document Number from the MRZ.dateOfBirth
- Date of Birth from the MRZ (Format: yyMMDD)dateOfExpiry
- Date of Expiry from the MRZ (Format: yyMMDD)
-
cancel
void cancel()
Cancels this session as soon as possible.
The ClosedListener will be called once the WebSocket Session is closed. The Close Reason will be "CANCELLED_BY_USER".
-
isOpen
boolean isOpen()
- Returns:
true if session is open
-
-
-
-