AAMVA Barcode Verifier
Defined in package com.scandit.datacapture.id.verification.aamvabarcode
- AamvaBarcodeVerificationStatus
Added in version 6.26.0
The verification status returned by the barcode verifier
- AUTHENTIC
Added in version 6.26.0
The barcode is authentic
- LIKELY_FORGED
Added in version 6.26.0
The barcode is likely forged
- FORGED
Added in version 6.26.0
The barcode is forged
- AamvaBarcodeVerificationResult
class AamvaBarcodeVerificationResult
Added in version 6.15.0
The result of a verification of AAMVA-compliant personal identification document done by AamvaBarcodeVerifier.
- allChecksPassed
boolean
getAllChecksPassed()Added in version 6.15.0
All checks passed and nothing suspicious about the document was detected.
- status
AamvaBarcodeVerificationStatus getStatus()
Added in version 6.26.0
Verification status containing the result of the verification
- AamvaBarcodeVerificationTask
class AamvaBarcodeVerificationTask
Added in version 6.15.0
The asynchronous verification task.
- doOnVerificationResult(action)
void
doOnVerificationResult(@NonNullFunction1
<@NonNull AamvaBarcodeVerificationResult, @NonNullUnit
> action)Added in version 6.15.0
Sets the callback that is going to be invoked when the verification is completed.
- AamvaBarcodeVerifier
class AamvaBarcodeVerifier
Added in version 6.15.0
Validates the authenticity of the document by scanning the barcode on the back. This verifier supports documents that follow the Driver License/Identification Card specification by the American Association of Motor Vehicle Administrators (AAMVA). It requires either the full (i.e. front & back) scanning mode or a single-sided scan of the back of the document. Start with creating a capture context and the verifier:
DataCaptureContext dataCaptureContext = DataCaptureContext.forLicenseKey("-- ENTER YOUR SCANDIT LICENSE KEY HERE --"); AamvaBarcodeVerifier verifier = AamvaBarcodeVerifier.create(dataCaptureContext);
Then either initialize the front & back scanning mode:
IdCaptureSettings settings = new IdCaptureSettings(); settings.setSupportedDocuments(IdDocumentType.DL_VIZ); settings.setCapturedSides(CapturedSides.FRONT_AND_BACK); IdCapture idCapture = IdCapture.create(dataCaptureContext, settings);
Or initialize single-sided scanning of the back of the document:
IdCaptureSettings settings = new IdCaptureSettings(); settings.setSupportedDocuments(IdDocumentType.AAMVA_BARCODE); IdCapture idCapture = IdCapture.create(dataCaptureContext, settings);
Once the capture is complete, trigger the verification process. This process is asynchronous and the result will be delivered once the verification has been completed:
@Override void didCaptureId(IdCapture idCapture, CapturedId capturedId) { AamvaBarcodeResult barcode = capturedId.getAamvaBarcode(); if (barcode != null) { // Trigger the verification. This process is asynchronous, so you may want to store the task and to reconnect the callback if your Activity is recreated. AamvaBarcodeVerificationTask task = verifier.verify(capturedId) .doOnVerificationResult { result -> if (result.allChecksPassed()) { // Nothing suspicious was detected. } else { // Document may be fraudulent or tampered with - proceed with caution. } } .doOnConnectionFailure { throwable -> // Error occurred during verification } } }
- create(context)
static @NonNull AamvaBarcodeVerifier create(@NonNull DataCaptureContext context)
Added in version 6.15.0
Creates a new instance of this verifier.
- verify(capturedId)
@NonNull AamvaBarcodeVerificationTask verify(CapturedId capturedId)
Added in version 6.15.0
Asynchronously conduct the verification of the specified AAMVA-compliant personal identification document.