Skip to content

RFID Chip Processing

Overview

Biometric documents are documents similar to the traditional ones except for one significant difference: they have an RFID chip embedded. The information stored on the chip is the same as that displayed on the data page of identity documents: full name, date of birth, place of birth, date of issue, expiration date, etc.

The chip also contains a biometric identifier in the form of a digital image of the identity document photo. The chip has a unique identification number and a digital signature as a protective measure.

The Document Reader SDK allows reading data from RFID chip memory (international standard ISO/IEC 14443) when working with devices equipped with NFC hardware, performing procedures of passive and active authentication.

Permissions

iOS

1. Add Near Field Communication Tag Reading under the Capabilities tab for the project’s target:

2. Add the NFCReaderUsageDescription permission to your Info.plist file, this is needed to access the NFC hardware:

Info.plist
<key>NFCReaderUsageDescription</key>
<string>NFC tag to read NDEF messages</string>

3. To access a particular function of the electronic document or to a file in its memory, it is required to select the corresponding applications first. It's a requirement of Apple to specify them explicitly in Info.plist.

Declare com.apple.developer.nfc.readersession.iso7816.select-identifiers—a list of application identifiers that the app must be able to read according to ISO7816:

Info.plist
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
    <string>A0000002471001</string>
    <string>E80704007F00070302</string>
    <string>A000000167455349474E</string>
    <string>A0000002480100</string>
    <string>A0000002480200</string>
    <string>A0000002480300</string>
    <string>A00000045645444C2D3031</string>
</array>

Identifiers of all supported by the Document Reader SDK standard applications are given below.

Identifier Description
A0000002471001 ePassport application
E80704007F00070302 eID application
A000000167455349474E eSign application
A0000002480100 eDL application
A0000002480200 eDL application
A0000002480300 eDL application
A00000045645444C2D3031 eDL application (Europe)

Android

Add the NFC permission to your AndroidManifest file, it's needed to access the NFC hardware:

AndroidManifest.xml
<uses-permission android:name="android.permission.NFC" />

Open RFID Reader

After the optical processing is completed and an access key is obtained, you can start the RFID chip processing.

To open the RFID chip reading activity and start its processing, use the method below.

DocReader.shared.startRFIDReader(fromPresenter: self, completion: { (action, results, error) in
    switch action {
    case .complete:
        print("Completed")
    case .cancel:
        print("Cancelled by user")
    case .error:
        print("Error: \(error)")
    default:
        break;
    }
})
[RGLDocReader.shared startRFIDReaderFromPresenter:self completion:^(RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error) {
    switch (action) {
        case RGLDocReaderActionComplete: {
            NSLog(@"Completed");
        }
        break;

        case RGLDocReaderActionCancel: {
            NSLog(@"Cancelled by user");
        }
        break;

        case RGLDocReaderActionError: {
            NSLog(@"Error: %@", error);
        }
        break;

        default:
        break;
    }
}];
DocumentReader.Instance().startRFIDReader(this@MainActivity, object : IRfidReaderCompletion() {
    override fun onCompleted(
        rfidAction: Int,
        documentReaderResults: DocumentReaderResults?,
        e: DocumentReaderException?
    ) {
        ...
    }
})
DocumentReader.Instance().startRFIDReader(MainActivity.this, new IRfidReaderCompletion() {
    @Override
    public void onCompleted(int action, @Nullable DocumentReaderResults results, @Nullable DocumentReaderException error) {
        ...
    }
});
DocumentReader.instance.rfid(RFIDConfig((action, results, error) {
  // handle results
}));
DocumentReader.startRFIDReader(false, false, false, _ => { }, _ => { })
DocumentReader.startRFIDReader(false, false, false, _ => { }, _ => { }).subscribe(m => { })
DocumentReader.startRFIDReader(false, false, false, function(m) { }, function(e) { })
// Android
public void StartRFID()
{
    DocumentReader.Instance().StartRFIDReader(this, this);
}

public void OnCompleted(int action, DocumentReaderResults results, string error)
{
    // handle completion
}

// iOS
void startRfid()
{
    RGLDocReader.Shared.StartRFIDReaderFromPresenter(this, HandleDocumentReaderRfidCompletion);
}

void HandleDocumentReaderRfidCompletion(RGLDocReaderAction action, RGLDocumentReaderResults result, string error)
{
    // handle completion
}

Stop RFID Reader

To stop the RFID chip reading activity programmatically, use the method below.

DocReader.shared.stopRFIDReader(errorMessage: "Custom error message") {
    print("Stopped")
}
[RGLDocReader.shared stopRFIDReaderWithErrorMessage:@"Custom error message" completion:^{
    NSLog(@"Stopped");
}];
DocumentReader.Instance().stopRFIDReader(this@MainActivity)
DocumentReader.Instance().stopRFIDReader(MainActivity.this);
DocumentReader.instance.stopRFIDReader();
DocumentReader.stopRFIDReader(_ => { }, _ => { })
DocumentReader.stopRFIDReader()
DocumentReader.stopRFIDReader(function(e) { }, function(e) { })
// Android
DocumentReader.Instance().StopRFIDReader(this);

// iOS
RGLDocReader.Shared.StopRFIDReaderWithErrorMessage("Custom error message", () =>
{
    Console.WriteLine("Stopped");
});

Next Steps