npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

covid-certificate-checker

v1.1.0

Published

Web-Library for Reading and Verifying Covid Vaccination Certificates

Downloads

33

Readme

Covid Certificate Checker Library

This Javascript-Library is for parsing and verifying EU Electronic Health Certificates (like the digital EU Covid Certificate) in Web-Applications.

Why another Library

There are already some great Javascript-Libraries, who are helping to decode and verify a digital Covid-Certificate. But most of them targets a NodeJS Environment or make it necessary to use polyfills for NodeJS-Functions. Like the Buffer-Api or the NodeJS-Crypto-Module. The library is intended for web browsers and mobile first.

How does it work?

Have a look at the official repository of the European eHealth network. There is a overview about the Design Principals. And also a rudimentary Implementation-Example.

Usage

You can easily use the Library as ES6 Module.

Install

npm i covid-certificate-checker

Read Certificate

import ElectronicHealthCertificateChecker from "covid-certificate-checker";

//Readout String form QR-Code
const testCertificate = "HC1:....";
const healthCertificateClaim = ElectronicHealthCertificateChecker.decode(testCertificate);
console.log(healthCertificateClaim);

Example:

{
  "iss": "DE",
  "iat": 1643356073,
  "exp": 1622316073,
  "hcert": {
    "v": [
      {
        "ci": "URN:UVCI:01DE/IZ12345A/5CWLU12RNOB9RXSEOP6FG8#W",
        "co": "DE",
        "dn": 1,
        "dt": "2021-05-29",
        "is": "Robert Koch-Institut",
        "ma": "ORG-100031184",
        "mp": "EU/1/20/1507",
        "sd": 2,
        "tg": "840539006",
        "vp": "1119349007"
      }
    ],
    "dob": "1964-08-12",
    "nam": {
      "fn": "Mustermann",
      "gn": "Erika",
      "fnt": "MUSTERMANN",
      "gnt": "ERIKA"
    },
    "ver": "1.0.0"
  }
}

Verify Signature

There are two ways to verify the signature. You can use a Document Signing Certificate like published in the German DSCList (field rawData):

For Verifying it's required that the Browser supports the Web Crypto Api

const {
  healthCertificateClaim,
  isVerified
} = await ElectronicHealthCertificateChecker.verify(testCertificate, rawKey);

Or you can verify the Signature by submitting a TrustList-Object in the format of the German DSCList. The matching is done over the Key Identifier (kid).

const {
  healthCertificateClaim,
  isVerified
} = await ElectronicHealthCertificateChecker.verifyWithTrustList(testCertificate, trustList);

Inspiration

Other projects and libraries I used as inspiration:

Build

The build is done with the Typescript-Compiler. Run npm run build.

Testing

You can run the Jasmine-Tests with npm run test:serve or npm run test.

Further Readings

Contribute

You can find Testdata under: DGC Testdata

Contribute

The classes I wrote in the src folder are under the MIT license. Not affected by this are for example used schemas, Qr-Codes, files, Documentation or test data that come from other authors. Please feel free to contribute or contact me if you have some Questions.