A JavaScript library to verify California Department of Motor Vehicle (CA DMV) Driver's Licenses and Identification Cards.
Press release: DMV to Releases New California Driver’s License and Identification Card Design with Advanced Security Features
Public Website: The California Driver's License Digital Signature
Documentation: Verifying Digital Signatures on California DL/ID Documents
This library provides an API for Web browsers and Node.js to verify CA DMV DL/ID PDF417 Verifiable Credential Barcodes data.
- Designed to handle the VCB data on current California Drivers Licenses and IDs.
- Restricts the resources that can be loaded during verification to those hosted by CA DMV.
npm install cadmv-dlid/verifier-sdkTo install locally for development:
git clone https://github.com/stateofca/cadmv-dlid-verifier-sdk.git
cd cadmv-dlid-verifier-sdk
npm installOnce PDF417 data has been scanned (out of scope for this library,
the string or bytes can be sent to the verify function. This
function will check for Verifiable Credential Barcodes
data and perform verification.
The main function of this library is async verify(options).
Basic usage:
import {verify} from 'cadmv-dlid-verifier-sdk';
const result = await verify({
data: scannedPdf417Data
});
if(result.valid) {
// data valid
} else {
// not valid, handle result.error if needed
}Force VCB data to be required:
import {verify} from 'cadmv-dlid-verifier-sdk';
const result = await verify({
data: scannedPdf417Data,
requireVcb: true
});Enable VCB revocation status verification:
import {verify} from 'cadmv-dlid-verifier-sdk';
const result = await verify({
data: scannedPdf417Data,
verifyStatus: true
});Available options:
{Uint8Array|string}options.data- PDF417 bytes or string.{Uint8Array|string}[options.encoding='utf8']- String encoding ifdata` is a string.{boolean}[options.requireVcb=false]-trueto require VCB data be present.{boolean}[options.verifyStatus=false]-trueto check VCB revocation status.{Function}[options.documentLoader=null]- Override defaultdocumentLoader.{string}[options.mode='prod']- Target deployment: 'prod' or 'uat'.{boolean}[options.debug=false]-trueto return debug details. Properties are informative only and subject to change.
Returns object with fields:
valid:trueif data is valid.error: Error details if data is not valid.debug: Debug details object if requested.
Please follow the existing code style. Pull requests are accepted.
If editing the README, please conform to the standard-readme specification.
Commercial support for this library is available upon request from Digital Bazaar: support@digitalbazaar.com
BSD-3-Clause © Digital Bazaar