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
Script for polybar to display and control media(not only Spotify) using DBus.

polybar-now-playing Script for polybar to display and control media(not only Spotify) using DBus Python script to display and control current playing

Dope Wizard 48 Dec 31, 2022
A simple Telegram bot that can add caption to any media on your channel

Channel Auto Caption This bot can add a caption for any media/document sent to a channel. Just deploy bot and add bot as admin to a channel. Deploy to

22 Nov 14, 2022
A telegram mirror bot with an integrated RSS feed reader.

About What is this repo? This is a slightly modified fork which includes some extra features & memes added to my liking. How's this different from the

11 May 15, 2022
KalmanFilterExercise - A Kalman Filter is a algorithmic filter that is used to estimate the state of an unknown variable

Kalman Filter Exercise What are Kalman Filters? A Kalman Filter is a algorithmic

4 Feb 26, 2022
🥀 Find the start of the token !

Discord Token Finder Find half of your target's token with just their ID. Install 🔧 pip install -r requeriments.txt Gui Usage 💻 Go to Discord Setti

zeytroxxx 2 Dec 22, 2021
❤️ Hi There Im EzilaX ❤️ A next gen powerful telegram group manager bot 😱 for manage your groups and have fun with other cool modules Made By Sadew Jayasekara 🔥

❤️ EzilaX v1 ❤️ Unmaintained. The new repo of @EzilaXBot is Public. (It is no longer based on this source code. The completely rewritten bot available

Sadew Jayasekara 18 Nov 24, 2021
Python wrapper for Wikipedia

Wikipedia API Wikipedia-API is easy to use Python wrapper for Wikipedias' API. It supports extracting texts, sections, links, categories, translations

Martin Majlis 369 Dec 30, 2022
A simple worker for OpenClubhouse to sync data.

OpenClubhouse-Worker This is a simple worker for OpenClubhouse to sync CH channel data.

100 Dec 17, 2022
Tiktok 2 Instagram With Python

Tiktok2Instagram 📸 About The Project What it does: Download the source video from a user inputted Tiktok URL. 📙 Add audio to the Tiktok video from a

Carter Belisle 4 Feb 06, 2022
An alternative launcher for Lunar Client which is aimed at portability and functionality.

Portaluna An alternative launcher for Lunar Client which is aimed at portability and functionality. Features Portable. Lightweight. Functional. Note:

4 Mar 05, 2022
Intelligent Trading Bot: Automatically generating signals and trading based on machine learning and feature engineering

Intelligent Trading Bot: Automatically generating signals and trading based on machine learning and feature engineering

Alexandr Savinov 326 Jan 03, 2023
This is a story bot, that will scrape stories from r/stories subreddit and convert it into an Audio File.

Introduction This is a story bot, that will scrape stories from r/stories subreddit and convert it into an Audio File. Installation pip install -r req

Yasho 11 Jun 30, 2022
The best discord Nuk3r !

Discord - Nuker ☢️ Nuk3r ☢️ STEP 1 ✅ We go create discord bot ! [] Go on https://discord.com/developers/applications [] Set the name of your applica

2s.py 1 Apr 16, 2022
A listener for RF >= 4.0 that prints a Stack Trace to console to faster find the code section where the failure appears.

robotframework-stacktrace A listener for RF = 4.0 that prints a Stack Trace to console to faster find the code section where the failure appears. Ins

marketsquare 16 Nov 24, 2022
VC-Music , Playing music without bot.

VC-Userbot A Telegram Userbot to play or streaming Audio and Video songs / files in Telegram Voice Chats. It's made with PyTgCalls and Pyrogram Requir

RioProjectX 8 Aug 04, 2022
A discord bot providing notifications of player activity on a minecraft server.

tos-alert A discord bot providing notifications of player activity on a minecraft server. Setup By default the app does not launch and will crash with

1 Jul 22, 2022
Scrape Twitter for Tweets

Backers Thank you to all our backers! 🙏 [Become a backer] Sponsors Support this project by becoming a sponsor. Your logo will show up here with a lin

Ahmet Taspinar 2.2k Jan 02, 2023
I was sick of having to hand my friends my phone, so I gave my Spotify some SMS features!

SMSpotifY Just a little tool so that my friends can text a phone number and add to my spotify queue for parties and such:) Features Roles / Access Con

Sara 2 Jan 17, 2022
A telegram bot that messages you available vaccine appointments in the Veneto region

Serenissimo, domande frequenti Chi sei? Sono Alberto Granzotto, libero professionista a Berlino. Mi occupo di servizi software, privacy, decentralizza

vrde 31 Sep 30, 2022
SMAM2 is a package manager built specifically for SourceMod.

SourceMod Addon Manager 2 (SMAM2) SMAM2 is a package manager built specifically for SourceMod. This was heavily inspired by Phil25's SMAM. I thought t

John Mascagni 6 Sep 16, 2022