Decode the Ontario proof of vaccination QR code

Overview

Decode the contents of the Ontario Proof of Vaccination (the "Smart Health Card QR Code")

Output

This is from my QR code, hopefully fully redacted although I suspect it tells you what kind of doses I got.

{
  "iss": "https://prd.pkey.dhdp.ontariohealth.ca",
  "nbf": 1634342670.448,
  "vc": {
    "type": [
      "https://smarthealth.cards#health-card",
      "https://smarthealth.cards#immunization",
      "https://smarthealth.cards#covid19"
    ],
    "credentialSubject": {
      "fhirVersion": "4.0.1",
      "fhirBundle": {
        "resourceType": "Bundle",
        "type": "collection",
        "entry": [
          {
            "fullUrl": "resource:0",
            "resource": {
              "resourceType": "Patient",
              "name": [
                {
                  "family": "FAMILY NAME",
                  "given": [
                    "FIRST NAME",
                    "MIDDLE NAMES"
                  ]
                }
              ],
              "birthDate": "YYYY-MM-DD"
            }
          },
          {
            "fullUrl": "resource:1",
            "resource": {
              "resourceType": "Immunization",
              "meta": {
                "security": [
                  {
                    "system": "https://smarthealth.cards/ial",
                    "code": "IAL1.4"
                  }
                ]
              },
              "status": "completed",
              "manufacturer": {
                "identifier": {
                  "system": "http://hl7.org/fhir/sid/mvx",
                  "value": "MOD"
                }
              },
              "vaccineCode": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/sid/cvx",
                    "code": "207"
                  },
                  {
                    "system": "http://snomed.info/sct",
                    "code": "28571000087109"
                  }
                ]
              },
              "occurrenceDateTime":  "YYYY-MM-DD",
              "lotNumber": "DDDDDDD",
              "patient": {
                "reference": "resource:0"
              },
              "performer": [
                {
                  "actor": {
                    "display": "ON, Canada"
                  }
                }
              ]
            }
          },
          {
            "fullUrl": "resource:2",
            "resource": {
              "resourceType": "Immunization",
              "meta": {
                "security": [
                  {
                    "system": "https://smarthealth.cards/ial",
                    "code": "IAL1.4"
                  }
                ]
              },
              "status": "completed",
              "manufacturer": {
                "identifier": {
                  "system": "http://hl7.org/fhir/sid/mvx",
                  "value": "MOD"
                }
              },
              "vaccineCode": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/sid/cvx",
                    "code": "207"
                  },
                  {
                    "system": "http://snomed.info/sct",
                    "code": "28571000087109"
                  }
                ]
              },
              "occurrenceDateTime": "YYYY-MM-DD",
              "lotNumber": "DDDDDDD",
              "patient": {
                "reference": "resource:0"
              },
              "performer": [
                {
                  "actor": {
                    "display": "ON, Canada"
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}

Setup

This runs in python3. I strongly suggest you set up a virtualenv before installing any python packages. Check one of these guides:

(If you're new to python, I appologize for the mess that is package management in python)

We need a JWT library, PyJWT seems to be the top python library. Sadly it doesn't support the body being compressed as happens with SHC. Thankfully, someone has created a fix for this, but it hasn't merged yet. https://github.com/jpadilla/pyjwt/pull/666

pip install 'git+https://github.com/Roguelazer/[email protected]#egg=pyjwt[crypto]'

OR

pip install -r requirements.txt

TODO

  • verify signature, not sure where the .well-known/jwjks.json is for Ontario
  • read in the PDF or an image with a QR Code?

Refs

Owner
Wesley Ellis
Wesley Ellis
Command-line program to download videos from YouTube.com and other video sites

youtube-dl - download videos from youtube.com or other video platforms INSTALLATION DESCRIPTION OPTIONS CONFIGURATION OUTPUT TEMPLATE FORMAT SELECTION

youtube-dl 116.4k Jan 07, 2023
A python to scratch API connector. Can fetch data from the API and send it back in cloud variables.

Scratch2py Scratch2py or S2py is a easy to use, versatile tool to communicate with the Scratch API Based of scratchclient by Raihan142857 Installation

20 Jun 18, 2022
A minimal open source mtg-like tcg game made in python that can be played on a terminal emulator using a keyboard.

TCG-TERM Project state: 🔧 🚧 🚧 🚧 Incomplete, In development 🚧 🚧 🚧 👷 (Keep in mind that at the moment, This project is currently undone, and wil

Amos 3 Aug 29, 2021
a small cli to generate AWS Well Architected Reports on the road

well-architected-review This repo intends to publish some scripts related to Well Architected Reviews. war.py extracts in txt & xlsx files all the WAR

4 Mar 18, 2022
A hilarious program that translates text to Google's

Bork, bork, bork! A hilarious program that translates text in a file to Google's "bork bork bork' language. How to use Download the main.py file. Chan

The Algorithmic 1 Dec 17, 2021
Script for downloading Coursera.org videos and naming them.

Coursera Downloader Coursera Downloader Introduction Features Disclaimer Installation instructions Recommended installation method for all Operating S

Coursera Downloader 9k Jan 02, 2023
Drop-in Replacement of pychallonge

pychal Pychal is a drop-in replacement of pychallonge with some extra features and support for new Python versions. Pychal provides python bindings fo

ZED 29 Nov 28, 2022
Python bindings for BigML.io

BigML Python Bindings BigML makes machine learning easy by taking care of the details required to add data-driven decisions and predictive power to yo

BigML Inc, Machine Learning made easy 271 Dec 27, 2022
Telegram Music Bot for YouTube/SoundCloud/Mixcloud

Telegram Music Bot Telegram Music Bot for YouTube/SoundCloud/Mixcloud This bot downloads and sends the audio when someone send a YouTube/SoundCloud/Mi

Calls Music 76 Jan 02, 2023
This is a very easy to use tool developed in python that will search for free courses from multiple sites including youtube and enroll in the ones in which it can.

Free-Course-Hunter-and-Enroller This is a very easy to use tool developed in python that will search for free courses from multiple sites including yo

Zain 12 Nov 12, 2022
Instagram-Reports is a tool made to ban any scam or bad person

ABOUT TOOL : Instagram-Reports is a tool made to ban any scam or bad person. Installation : sudo apt-get update -y sudo apt-get upgrade -y apt insta

Evan Al Mahmud Irfan ථ 1 Dec 20, 2021
Music bot for Discord

Treble Music bot for Discord Youtube is after music bots on Discord. So we are here to fill the void. Introducing Treble, the next generation of Disco

Aja Khanal 0 Sep 16, 2022
Construindo API's robustas utilizando Python

🐂 Construindo API's robustas utilizando Python Neste tutorial vamos aprender a construir API's utilizando Python e FastAPI, integrá-las a serviços ex

luizalabs 296 Dec 13, 2022
Passive income method via SerpClix. Uses a bot to accept clicks.

SerpClixBotSearcher This bot allows you to get passive income from SerpClix. Each click is usually $0.10 (sometimes $0.05 if offer isnt from the US).

Jason Mei 3 Sep 01, 2021
A Python Program to determine Degree of Profanity of Tweets

tweetx tweetx is a program to detect racial slurs in Twitter Tweets. Racial Abuse on Twitter is becoming quite a serious issue in recent times. tweetx

Kartik Poojari 3 Nov 11, 2021
A results generator and automatic token checker for Yandex Contest

Yandex contest Python checking tools A results generator and automatic token checker for Yandex Contest. Версия на русском языке Installation Clone th

Nikolay Chechulin 9 Dec 14, 2022
🐙 Share your Github stats for 2020 on Twitter

Year on Github 🐙 Share your Github stats for 2020 on Twitter. This project contains a small web app that let's you share stats about your Github acti

Johannes Rieke 129 Dec 25, 2022
Converts a text file of songs to a playlist on your Spotify account.

Playlist Converter Convert a text file of songs to a playlist on your Spotify account. Create your playlists faster instead of manually searching for

Priya Aggarwal 18 Dec 21, 2022
This will create new discord accounts and add them to your server

Discord-Botter This tool will create new discord accounts add them to your server, this tool needs a captcha api like capmonster.cloud or anti-captcha

Shahzain 27 Nov 30, 2022
SelfBot, a lots of features: Mass DM , Nuke, Raid... and more!

SelfBot, a lots of features: Mass DM , Nuke, Raid... and more!

eryycr 2 Nov 10, 2021