AAMVA Barcode Verifier

Defined in package com.scandit.datacapture.id.verification.aamvabarcode

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.

toJson()
@NonNull String toJson()

Added in version 6.15.0

Returns the JSON representation of this object.

AamvaBarcodeVerificationTask
class AamvaBarcodeVerificationTask

Added in version 6.15.0

The asynchronous verification task.

doOnVerificationResult(action)
void doOnVerificationResult(@NonNull Function1<@NonNull AamvaBarcodeVerificationResult, @NonNull Unit> action)

Added in version 6.15.0

Sets the callback that is going to be invoked when the verification is completed.

doOnConnectionFailure(action)
void doOnConnectionFailure(@NonNull Function1<@NonNull Throwable, @NonNull Unit> action)

Added in version 6.15.0

Sets the callback that is going to be invoked when the verification cannot be 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 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.setSupportedSides(SupportedSides.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, IdCaptureSession session) {
    CapturedId capturedId = session.getNewlyCapturedId();
    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.