Methods
(static) scanPassport(bacSpec, callbackopt, errorCallbackopt) → {Promise.<module:passportreader~ScanResult>}
Scan a biometric passport and return the data extracted from its NFC chip
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
bacSpec |
module:passportreader~BACSpec | BAC spec | |
callback |
module:passportreader~PassportScanCallback |
<optional> |
Called when passport scan finishes |
errorCallback |
function |
<optional> |
Called when passport scan fails |
- Source:
Returns:
If callback is not specified returns a promise
- Type
- Promise.<module:passportreader~ScanResult>
Type Definitions
BACSpec
Basic Access Control (BAC) specification
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
documentNumber |
string | Passport number |
dateOfBirth |
string | Date of birth of the passport holder in YYYY-MM-DD format |
dateOfExpiry |
string | Passport's date of expiry in YYYY-MM-DD format |
- Source:
PassportScanCallback(result)
Called when passport scan finishes
Parameters:
Name | Type | Description |
---|---|---|
result |
module:passportreader~ScanResult | Result may be undefined or null if the user cancels the scan |
- Source:
ScanResult
Passport scan result
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
documentCode |
string | Document code |
issuingState |
string | Issuing state |
primaryIdentifier |
string | Primary identifier (e.g., last name) |
secondaryIdentifiers |
Array.<string> | Secondary identifiers (e.g., given names) |
nationality |
string | Nationality of the passport holder |
documentNumber |
string | Document number |
personalNumber |
string | Personal number |
dateOfBirth |
string | Date of birth of the passport holder YYYY-MM-DD |
gender |
string | Gender of the passport holder |
dateOfExpiry |
string | Date of expiry of the passport YYYY-MM-DD |
image |
string | Image of the holder's face as URL data scheme (e.g., data:image/jpeg;base64,imageData) |
- Source: