Class EmrtdConnector

    • Constructor Detail

      • EmrtdConnector

        EmrtdConnector(String clientId, String webSocketUrl, ClosedListener closedListener, StatusListener statusListener, EmrtdPassportListener emrtdPassportListener)
        Parameters:
        clientId - Client Id
        webSocketUrl - Url of the WebSocket endpoint
        closedListener - 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

      • 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 Tag
        validationId - 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)
      • connect

         void connect(IsoDep isoDep, ConnectionOptions options)

        Starts the session.

        Example usage:

        
        		// Access Key values from the MRZ
        		String documentNumber = "123456789";
        		String dateOfBirth = "970101"; // yyMMDD
        		String dateOfExpiry = "221212"; // yyMMDD
        	
        		// Unique transaction ID, usually from your server
        		String validationId = UUID.randomUUID().toString();
        	
        		ConnectionOptions options = new ConnectionOptions.Builder()
        				.setChipAccessKeyFromMrz(documentNumber, dateOfBirth, dateOfExpiry)
        				.setValidationId(validationId)
        				.build();
        	
        		emrtdConnector.connect(isoDep, options);
        	
        Parameters:
        isoDep - IsoDep of an ICAO-9303 NFC Tag.
        options - Options for this read.
      • 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