Python NZ COVID Pass Verifier/Generator

Overview

Python NZ COVID Pass Verifier/Generator

This is quick proof of concept verifier I coded up in a few hours using various libraries to parse and generate QR codes in the NZ COVID Pass format.

Important note: I don't know anything about CWT or CBOR and I'm using libraries that perform cryptographic functions that I haven't vetted. Do not use this code for anything other than learning and experimentation.

Installing

$ sudo apt-get install python3-zbar
$ pip3 install -r requirements.txt

Docker

docker build -t nzcovidpass .
docker run -v $(pwd):/app/qr --rm nzcovidpass --qrcode-file /app/qr/Image.jpg

Usage

Verify NZ COVID Pass

usage: nz_covid_pass_verifier.py [-h] --qrcode-file QRCODE_FILE [--did-file DID_FILE]

NZ COVID Pass Verifier.

required arguments:
  --qrcode-file QRCODE_FILE
                        file name containing NZ COVID pass QR code

optional arguments:
  -h, --help            show this help message and exit
  --did-file DID_FILE   file name containing DID with verification keys

Supply a QR code filename and optional DID document containing verification keys, if you omit a DID document the official Ministry of Health verification keys will be used.

You can try with the sample QR codes provided:

$ python3 nz_covid_pass_verifier.py --qrcode-file examples/moh/valid/nzcp.png --did-file examples/moh/valid/did.json

iss: did:web:nzcp.covid19.health.nz
nbf: 2021-11-02 20:05:30+00:00
exp: 2031-11-02 20:05:30+00:00
vc:
  '@context':
  - https://www.w3.org/2018/credentials/v1
  - https://nzcp.covid19.health.nz/contexts/v1
  credentialSubject:
    dob: '1960-04-16'
    familyName: Sparrow
    givenName: Jack
  type:
  - VerifiableCredential
  - PublicCovidPass
  version: 1.0.0
jti: urn:uuid:60a4f54d-4e30-4332-be33-ad78b1eafa4b

Generate NZ COVID Pass

usage: nz_covid_pass_generator.py [-h] --signing-key-file SIGNING_KEY_FILE --qrcode-file QRCODE_FILE --dob DOB --given-name GIVEN_NAME --family-name FAMILY_NAME [--validity VALIDITY]

NZ COVID Pass Generator.

required arguments:
  --signing-key-file SIGNING_KEY_FILE
                        filename containing private signing key in JWK format
  --qrcode-file QRCODE_FILE
                        filename where QR code should be saved
  --dob DOB             date of birth for COVID Pass
  --given-name GIVEN_NAME
                        given name for COVID Pass
  --family-name FAMILY_NAME
                        family name for COVID Pass

optional arguments:
  -h, --help            show this help message and exit
  --validity VALIDITY   validity of NZ COVID Pass in days, default: 365

Example:

python3 nz_covid_pass_generator.py \
    --dob "1986-07-14" --given-name "SpongeBob" --family-name "SquarePants" \
    --signing-key-file examples/mine/private_signing_key.json \
    --qrcode-file examples/mine/spongebob-squarepants.png
Owner
NZ COVID Pass Community
NZ COVID Pass resources provided by the community
NZ COVID Pass Community
⏰ Shutdown Timer is an application that you can shutdown, restart, logoff, and hibernate your computer with a timer.

Shutdown Timer is a an application that you can shutdown, restart, logoff, and hibernate your computer with a timer. After choosing an action from the

Mehmet Güdük 5 Jun 27, 2022
Repository, with small useful and functional applications

Repositorio,com pequenos aplicativos uteis e funcionais A ideia e ir deselvolvendo pequenos aplicativos funcionais e adicionar a este repositorio List

GabrielDuke 6 Dec 06, 2021
Tutorials for on-ramping to StarkNet

Full-Stack StarkNet Repo containing the code for a short tutorial series I wrote while diving into StarkNet and learning Cairo. Aims to onramp existin

Sam Barnes 71 Dec 07, 2022
Gives criticality score for an open source project

Open Source Project Criticality Score (Beta) This project is maintained by members of the Securing Critical Projects WG. Goals Generate a criticality

Open Source Security Foundation (OpenSSF) 1.1k Dec 23, 2022
A project for the Qvault Hackathon, 2022-01-17

musical-octo-engine Steps to run brew install python-tk brew install portaudio

Erik Kristofer Anderson 2 May 17, 2022
A Notifier Program that Notifies you to relax your eyes Every 15 Minutes👀

Every 15 Minutes is an application that is used to Notify you to Relax your eyes Every 15 Minutes, This is fully made with Python and also with the us

Ashely Sato 1 Nov 02, 2021
A bash-like intrepreted language

A Bash-like interpreted scripting language.

AshVXmc 1 Oct 28, 2021
This package tries to emulate the behaviour of syntax proposed in PEP 671 via a decorator

Late-Bound Arguments This package tries to emulate the behaviour of syntax proposed in PEP 671 via a decorator. Usage Mention the names of the argumen

Shakya Majumdar 0 Feb 06, 2022
Macros in Python: quasiquotes, case classes, LINQ and more!

MacroPy3 1.1.0b2 MacroPy is an implementation of Syntactic Macros in the Python Programming Language. MacroPy provides a mechanism for user-defined fu

Li Haoyi 3.2k Jan 06, 2023
Using Python to parse through email logs received through several backup systems.

outlook-automated-backup-control Backup monitoring on a mailbox: In this mailbox there will be backup logs. The identification will based on the follo

Connor 2 Sep 28, 2022
Wrappers around the most common maya.cmds and maya.api use cases

Maya FunctionSet (maya_fn) A package that decompose core maya.cmds and maya.api features to a set of simple functions. Tests The recommended approach

Ryan Porter 9 Mar 12, 2022
Arknights gacha simulation written in Python

Welcome to arknights-gacha repository This is my shameless attempt of simulating Arknights gacha. Current supported banner types (with potential bugs)

Swyrin 3 May 07, 2022
A programming language that for tech savvy graphic designers

Microsoft Hackathon - PhoTex Idea A programming language that allows tech savvy graphic designers develop scalable vector graphics using plain text co

Joe Furfaro 5 Nov 14, 2021
automate some stuff so I can be more noob

dota automate some stuff so I can be more noob This is a simple project, but one that I've wanted forever! I use pyautogui, time, smtplib and datetime

Aaron Allen 17 Oct 18, 2022
BasicVSR++ function for VapourSynth

BasicVSR++ BasicVSR++: Improving Video Super-Resolution with Enhanced Propagation and Alignment Ported from https://github.com/open-mmlab/mmediting De

Holy Wu 34 Nov 28, 2022
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Advent Of Code 2021 - Python English Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels th

Coral Izquierdo Muñiz 2 Jan 09, 2022
Python module used to generate random facts

Randfacts is a python library that generates random facts. You can use randfacts.get_fact() to return a random fun fact. Disclaimer: Facts are not gua

Tabulate 14 Dec 14, 2022
Allows you to purge all reply comments left by a user on a YouTube channel or video.

YouTube Spammer Purge Allows you to purge all reply comments left by a user on a YouTube channel or video. Purpose Recently, there has been a massive

4.3k Jan 09, 2023
PwnDatas-DB-Project(PDDP)

PwnDatas-DB-Project PwnDatas-DB-Project(PDDP) 安裝依賴: pip3 install pymediawiki 使用: cd /opt git https://github.com/JustYoomoon/PwnDatas-DB-Project.git c

21 Jul 16, 2021
A community based economy bot with python works only with python 3.7.8 as web3 requires cytoolz

A community based economy bot with python works only with python 3.7.8 as web3 requires cytoolz has some issues building with python 3.10

4 Jan 01, 2022