mDL Processing Configuration
This page contains the advanced onfiguration parameters and methods for the Mobile Driver's License processing.
Device Engagement
Device Engagement is the initial phase in which the Holder’s device and the Verifier establish a secure connection and exchange the parameters required to start mDL data transfer.
The Mobile Document Reader SDK provides several separate methods to perform the engagement with or without the predefined UI. See the details and examples further.
Engagement with Predefined UI
- To Engage the device via QR code, use:
DocReader.shared.startEngageDevice(fromPresenter: self, type: .QR) { deviceEngagement, error in
}
[[RGLDocReader shared] startEngageDeviceFromPresenter:self type:RGLeMDLDeviceEngagementQR completion:^(RGLDeviceEngagement * _Nullable deviceEngagement, NSError * _Nullable error) {
}];
DocumentReader.Instance().startEngageDevice(
this@MainActivity, eMDLDeviceEngagement.QR, object : IDeviceEngagementCompletion {
override fun onCompleted(
deviceEngagement: DeviceEngagement?,
error: DocumentReaderException?
) {
}
}
)
DocumentReader.Instance().startEngageDevice(getActivity(), eMDLDeviceEngagement.QR, new IDeviceEngagementCompletion() {
@Override
public void onCompleted(@Nullable DeviceEngagement deviceEngagement, @Nullable DocumentReaderException error) {
}
});
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
- To Engage the device via NFC, use:
DocReader.shared.startEngageDevice(fromPresenter: self, type: .NFC) { deviceEngagement, error in
}
[[RGLDocReader shared] startEngageDeviceFromPresenter:self type:RGLeMDLDeviceEngagementNFC completion:^(RGLDeviceEngagement * _Nullable deviceEngagement, NSError * _Nullable error) {
}];
DocumentReader.Instance().startEngageDevice(
this@MainActivity, eMDLDeviceEngagement.NFC, object : IDeviceEngagementCompletion {
override fun onCompleted(
deviceEngagement: DeviceEngagement?,
error: DocumentReaderException?
) {
}
}
)
DocumentReader.Instance().startEngageDevice(getActivity(), eMDLDeviceEngagement.NFC, new IDeviceEngagementCompletion() {
@Override
public void onCompleted(@Nullable DeviceEngagement deviceEngagement, @Nullable DocumentReaderException error) {
}
});
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
Engagement without UI
- To Engage the device via QR code, use:
let qrCode = "..."
DocReader.shared.engageDeviceData(qrCode) { deviceEngagement, error in
}
NSString *qrCode = @"...";
[[RGLDocReader shared] engageDeviceData:qrCode completion:^(RGLDeviceEngagement * _Nullable deviceEngagement, NSError * _Nullable error) {
}];
//val qrCode = "..."
DocumentReader.Instance().engageDeviceData(
qrCode, object : IDeviceEngagementCompletion {
override fun onCompleted(
deviceEngagement: DeviceEngagement?,
error: DocumentReaderException?
) {
}
})
// String qrCode = "...";
DocumentReader.Instance().engageDeviceData(qrCode, new IDeviceEngagementCompletion() {
@Override
public void onCompleted(@Nullable DeviceEngagement deviceEngagement, @Nullable DocumentReaderException error) {
}
});
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
- To Engage the device via NFC, use:
DocReader.shared.engageDeviceNFC(self) { deviceEngagement, error in
}
[[RGLDocReader shared] engageDeviceNFC:self completion:^(RGLDeviceEngagement * _Nullable deviceEngagement, NSError * _Nullable error) {
}];
//val isoDep
DocumentReader.Instance().engageDeviceNFC(
isoDep, object : IDeviceEngagementCompletion {
override fun onCompleted(
deviceEngagement: DeviceEngagement?,
error: DocumentReaderException?
) {
}
})
// IsoDep isoDep = ...;
DocumentReader.Instance().engageDeviceNFC(isoDep, new IDeviceEngagementCompletion() {
@Override
public void onCompleted(@Nullable DeviceEngagement deviceEngagement, @Nullable DocumentReaderException error) {
}
});
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
Data Retrieval
Data retrieval is the phase in which the requested mDL data is securely transmitted from the Holder’s device to the Verifier after a successful device engagement.
The Mobile Document Reader SDK provides several separate methods to perform the retrieval with or without the predefined UI. See the details and examples further.
Additionally, you can control Intent to Retain for each value of mDL fields and select one of the Presets to manage what fields exactly need to be read.
Retrieval with Predefined UI
- To Retrieve the data via Bluetooth, use:
let dataRetrieval = DocReader.DataRetrieval(deviceRetrieval: .BLE)
DocReader.shared.startRetrieveData(deviceEngagement, dataRetrieval: dataRetrieval) { action, results, error in
}
RGLDataRetrieval *dataRetrieval = [[RGLDataRetrieval alloc] initWithDeviceRetrieval:RGLeMDLDeviceRetrievalBLE];
[[RGLDocReader shared] startRetrieveData:deviceEngagement dataRetrieval:dataRetrieval completion:^(RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error) {
}];
val dataRetrieval = DataRetrieval(eMDLDeviceRetrieval.BLE)
DocumentReader.Instance().startRetrieveData(
this@MainActivity, deviceEngagement, dataRetrieval, object : IDocumentReaderCompletion {
override fun onCompleted(
action: Int,
documentReaderResults: DocumentReaderResults?,
e: DocumentReaderException?
) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(documentReaderResults)
}
}
})
DataRetrieval dataRetrieval = new DataRetrieval(eMDLDeviceRetrieval.BLE);
DocumentReader.Instance().startRetrieveData(getActivity(), deviceEngagement, dataRetrieval, new IDocumentReaderCompletion() {
@Override
public void onCompleted(int action, @Nullable DocumentReaderResults results, @Nullable DocumentReaderException error) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(results)
}
}
});
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
- To Retrieve the data via NFC, use:
let dataRetrieval = DocReader.DataRetrieval(deviceRetrieval: .NFC)
DocReader.shared.startRetrieveData(deviceEngagement, dataRetrieval: dataRetrieval) { action, results, error in
}
RGLDataRetrieval *dataRetrieval = [[RGLDataRetrieval alloc] initWithDeviceRetrieval:RGLeMDLDeviceRetrievalNFC];
[[RGLDocReader shared] startRetrieveData:deviceEngagement dataRetrieval:dataRetrieval completion:^(RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error) {
}];
val dataRetrieval = DataRetrieval(eMDLDeviceRetrieval.NFC)
DocumentReader.Instance().startRetrieveData(
this@MainActivity, deviceEngagement, dataRetrieval, object : IDocumentReaderCompletion {
override fun onCompleted(
action: Int,
documentReaderResults: DocumentReaderResults?,
e: DocumentReaderException?
) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(documentReaderResults)
}
}
})
DataRetrieval dataRetrieval = new DataRetrieval(eMDLDeviceRetrieval.NFC);
DocumentReader.Instance().startRetrieveData(getActivity(), deviceEngagement, dataRetrieval, new IDocumentReaderCompletion() {
@Override
public void onCompleted(int action, @Nullable DocumentReaderResults results, @Nullable DocumentReaderException error) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(results)
}
}
});
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
Retrieval without UI
- To Retrieve the data via Bluetooth, use:
let dataRetrieval = DocReader.DataRetrieval(deviceRetrieval: .BLE)
DocReader.shared.retrieveDataBLE(deviceEngagement, dataRetrieval: dataRetrieval) { action, results, error in
}
RGLDataRetrieval *dataRetrieval = [[RGLDataRetrieval alloc] initWithDeviceRetrieval:RGLeMDLDeviceRetrievalBLE];
[[RGLDocReader shared] retrieveDataBLE:deviceEngagement dataRetrieval:dataRetrieval completion:^(RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error) {
}];
// val deviceEngagement
val dataRetrieval = DataRetrieval(eMDLDeviceRetrieval.BLE)
DocumentReader.Instance().retrieveDataBLE(
this@MainActivity,
deviceEngagement, dataRetrieval, object : IDocumentReaderCompletion {
override fun onCompleted(
action: Int,
documentReaderResults: DocumentReaderResults?,
error: DocumentReaderException?
) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(documentReaderResults)
}
}
})
// DeviceEngagement deviceEngagement;
DataRetrieval dataRetrieval = new DataRetrieval(eMDLDeviceRetrieval.BLE);
DocumentReader.Instance().retrieveDataBLE(getActivity(), deviceEngagement, dataRetrieval, new IDocumentReaderCompletion() {
@Override
public void onCompleted(int action, @Nullable DocumentReaderResults documentReaderResults, @Nullable DocumentReaderException error) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(documentReaderResults)
}
}
});
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
- To Retrieve the data via NFC, use:
let dataRetrieval = DocReader.DataRetrieval(deviceRetrieval: .NFC)
DocReader.shared.retrieveDataNFC(dataRetrieval) { action, results, error in
}
RGLDataRetrieval *dataRetrieval = [[RGLDataRetrieval alloc] initWithDeviceRetrieval:RGLeMDLDeviceRetrievalNFC];
[[RGLDocReader shared] retrieveDataNFC:dataRetrieval completion:^(RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error) {
}];
// val isoDep
val dataRetrieval = DataRetrieval(eMDLDeviceRetrieval.NFC)
DocumentReader.Instance().retrieveDataNFC(
isoDep, dataRetrieval, object : IDocumentReaderCompletion {
override fun onCompleted(
action: Int,
documentReaderResults: DocumentReaderResults?,
error: DocumentReaderException?
) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(documentReaderResults)
}
}
})
// IsoDep isoDep = ...;
DataRetrieval dataRetrieval = new DataRetrieval(eMDLDeviceRetrieval.NFC);
DocumentReader.Instance().retrieveDataNFC(isoDep, dataRetrieval, new IDocumentReaderCompletion() {
@Override
public void onCompleted(int action, @Nullable DocumentReaderResults documentReaderResults, @Nullable DocumentReaderException error) {
if (action == DocReaderAction.COMPLETE) {
//processingResults(documentReaderResults)
}
}
});
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
Intent to Retain
Intent to retain is a per-field flag in the verifier’s request that indicates whether a data element is intended to be stored after the session. The Holder evaluates this intent as part of its Disclosure Policy and releases only permitted fields. Enforcement of non-retention when intentToRetain = false is the responsibility of the Verifier implementation.
By default, Regula Document Reader SDK requests all available fields from the Holder with intentToRetain = true.
- To manually mark all mDL fields for reading without retention, use:
let dataRetrieval = DocReader.DataRetrieval(deviceRetrieval: .BLE)
let request = DocReader.DocumentRequest18013MDL()
request.disableIntentToRetainValues()
dataRetrieval.requests = [request]
RGLDataRetrieval *dataRetrieval = [[RGLDataRetrieval alloc] initWithDeviceRetrieval:RGLeMDLDeviceRetrievalBLE];
RGLDocumentRequest18013MDL *request = [[RGLDocumentRequest18013MDL alloc] init];
[request disableIntentToRetainValues];
dataRetrieval.requests = @[request];
val dataRetrieval = DataRetrieval(eMDLDeviceRetrieval.BLE)
val documentRequest18013MDL = DocumentRequest18013MDL()
documentRequest18013MDL.disableIntentToRetainValues()
dataRetrieval.addDocRequest(documentRequest18013MDL)
DataRetrieval dataRetrieval = new DataRetrieval(eMDLDeviceRetrieval.BLE);
DocumentRequest18013MDL documentRequest18013MDL = new DocumentRequest18013MDL();
documentRequest18013MDL.disableIntentToRetainValues();
dataRetrieval.addDocRequest(documentRequest18013MDL);
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
- To manually configure all mDL fields to be retained during reading, use:
let dataRetrieval = DocReader.DataRetrieval(deviceRetrieval: .BLE)
let request = DocReader.DocumentRequest18013MDL()
request.enableIntentToRetainValues()
dataRetrieval.requests = [request]
RGLDataRetrieval *dataRetrieval = [[RGLDataRetrieval alloc] initWithDeviceRetrieval:RGLeMDLDeviceRetrievalBLE];
RGLDocumentRequest18013MDL *request = [[RGLDocumentRequest18013MDL alloc] init];
[request enableIntentToRetainValues];
dataRetrieval.requests = @[request];
val dataRetrieval = DataRetrieval(eMDLDeviceRetrieval.BLE)
val documentRequest18013MDL = DocumentRequest18013MDL()
documentRequest18013MDL.enableIntentToRetainValues()
dataRetrieval.addDocRequest(documentRequest18013MDL)
DataRetrieval dataRetrieval = new DataRetrieval(eMDLDeviceRetrieval.BLE);
DocumentRequest18013MDL documentRequest18013MDL = new DocumentRequest18013MDL();
documentRequest18013MDL.enableIntentToRetainValues();
dataRetrieval.addDocRequest(documentRequest18013MDL);
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
- See the example of setting custom
intentToRetainvalues for the Data Retrieval process below.
let dataRetrieval = DocReader.DataRetrieval(deviceRetrieval: .BLE)
let request = DocReader.DocumentRequest18013MDL()
request.familyName = .true
request.givenName = .true
request.birthDate = .false
dataRetrieval.requests = [request]
RGLDataRetrieval *dataRetrieval = [[RGLDataRetrieval alloc] initWithDeviceRetrieval:RGLeMDLDeviceRetrievalBLE];
RGLDocumentRequest18013MDL *request = [[RGLDocumentRequest18013MDL alloc] init];
request.givenName = RGLeMDLIntentToRetainTrue;
request.familyName = RGLeMDLIntentToRetainTrue;
request.birthDate = RGLeMDLIntentToRetainFalse;
dataRetrieval.requests = @[request];
val dataRetrieval = DataRetrieval(eMDLDeviceRetrieval.BLE)
val documentRequest18013MDL = DocumentRequest18013MDL()
documentRequest18013MDL.givenName = eMDLIntentToRetain.TRUE
documentRequest18013MDL.familyName = eMDLIntentToRetain.TRUE
documentRequest18013MDL.birthDate = eMDLIntentToRetain.FALSE
dataRetrieval.addDocRequest(documentRequest18013MDL)
DataRetrieval dataRetrieval = new DataRetrieval(eMDLDeviceRetrieval.BLE);
DocumentRequest18013MDL documentRequest18013MDL = new DocumentRequest18013MDL();
documentRequest18013MDL.givenName = eMDLIntentToRetain.TRUE;
documentRequest18013MDL.familyName = eMDLIntentToRetain.TRUE;
documentRequest18013MDL.birthDate = eMDLIntentToRetain.FALSE;
dataRetrieval.addDocRequest(documentRequest18013MDL);
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO
Presets
Document Request Presets are predefined configurations that specify which mDL data fields the Verifier requests from the Holder during Data Retrieval. When a preset is applied, only the fields defined in the preset are requested and processed, while all other mDL fields are ignored.
See the list of all available presets with their requested fields in the following table.
| Preset | Requested Fields (JSON) | Description |
|---|---|---|
ALL |
All available mDL fields | Requests all fields. Applied by default. |
AGE |
|
Retrieves the portrait data and checks whether the holder is at least 18 years old. |
STANDARD_ID |
|
Retrieves the field set, regular for the ID document. |
TRAVEL |
|
Retrieves the field set, regular for the travel document. |
DRIVERS_LICENSE |
All available fields except administrative_number |
Retrieves the field set, regular for the Driver's License. |
Info
You can also set the intent to retain for all fields within the selected preset at once.
See the example of the preset usage below.
let dataRetrieval = DocReader.DataRetrieval(deviceRetrieval: .BLE)
dataRetrieval.setDocRequestPreset(.age, intentToRetain: .false)
RGLDataRetrieval *dataRetrieval = [[RGLDataRetrieval alloc] initWithDeviceRetrieval:RGLeMDLDeviceRetrievalBLE];
[dataRetrieval setDocRequestPreset:RGLeMDLDocRequestPresetAge intentToRetain:RGLeMDLIntentToRetainFalse];
val dataRetrieval = DataRetrieval(eMDLDeviceRetrieval.BLE)
dataRetrieval.setDocRequestPreset(eMDLDocRequestPreset.AGE, eMDLIntentToRetain.FALSE)
DataRetrieval dataRetrieval = new DataRetrieval(eMDLDeviceRetrieval.BLE);
dataRetrieval.setDocRequestPreset(eMDLDocRequestPreset.AGE, eMDLIntentToRetain.FALSE);
// TODO
// TODO
// Android
// TODO
// iOS
// TODO
// TODO
// TODO
// TODO