0.0.5 • Published 3 years ago
@pathcheck/universal-verifier-sdk v0.0.5
Universal Verifier SDK for QRCode-based Verifiable Credentials
SDK to verify all Verifiable QR codes out there.
Supported Platforms
- CRED: PathCheck's PaperCreds
- DIVOC: COWIN's Credentials in India
- HC1: Europe's Digital Covid Certificates by the eHealth Network
- SHC: SmartHealth Cards
- JXT: A BBS+ W3C Verifiable Credentials minimized with JSON-XT
- CBLD: A CBOR-LD version of W3C Verifiable Credentials.
- VDS: ICAO's Visible Digital Seals
- Excelsior: NYC's COVID pass
Install
npm install @pathcheck/universal-verifier-sdk --save
Usage
Import the library
const { verifyQRCode } = require('@pathcheck/universal-verifier-sdk');
Read a Verifiable QR
const qr = 'CRED:STATUS:2:GBCQEIIAWXECNVIUJQXPDV44EW3UHJIGNBGK4ITZAKX37MJNXG6IQZDXS7ZAEIB3ROQ2EWIRYH66FGPJOWBWP3MK6YTYVGJE332CXM6V2YQOBLHECU:1A9.PCF.PW:1//JD82'
Check if it's valid and get the unpacked version of the QR with:
const result = await verifyQRCode(qr);
Result will be on the format of the package type before signature depending on the QR format. Package types include:
- Array of elements
- JSON Web Token
- CBOR Web Token
- JSON-LD documents
Development
npm install
Test
npm test
Contributing
Issues and pull requests are very welcome! :)