Golang libraries for generating QR codes for Smart Health Cards representing COVID-19 Immunizations

go-smarthealthcards

Golang libraries for generating QR codes for Smart Health Cards representing COVID-19 Immunizations.

Usage

Individual Libraries

You can use the libraries in this module independently:

  • ecdsa: load an ECDSA P-256 private key (*crypto/ecdsa.PrivateKey) from string representations of its key parameters; see here
  • fhirbundle: construct and marshal a (pre-compressed) JWS payload containing an FHIR bundle of information representing COVID-19 immunizations; see here and here
  • jws: create a compact serialization of a JSON Web Signature (JWS) with the ECDSA P-256 SHA-256 signing algorithm and DEFLATE compression of the payload and create a serialization of a JSON Web Key Set representing the public key of an ECDSA P-256 key; see here, here, and here
  • qrcode: create a QR code in PNG format encoding the JWS of a smart health card such that smart devices such as iPhones can scan the QR code and load the smart health card information in applications such as the Wallet and Health apps for the iPhone; see here and here

Full End-to-End Example

You can compose the libraries in this module together for a full end-to-end solution:

Generate a signing key and set environment variables

$ eval `go run utils/keygen.go`

$ env | grep SMART_HEALTH_CARDS
SMART_HEALTH_CARDS_KEY_Y=101429470610882177913719193785842901742785774962016470785491662750285266794880
SMART_HEALTH_CARDS_KEY_X=54331567703018507947599648321661141913001722275227305175319502486118882894610
SMART_HEALTH_CARDS_KEY_D=71127180180681625720019072005809291232785768180646325329981160435676730627285

Start an example web server

$ go run examples/server.go

Inspect the JSON Web Key Set representation of the signing key's public key

$ curl -s http://localhost:8080/.well-known/jwks.json | jq .
{
  "keys": [
    {
      "kty": "EC",
      "kid": "9G2pzRWd-FL4XwNpDuXUHnG5egt38E78hSqMQzL5v3E",
      "use": "sig",
      "alg": "ES256",
      "crv": "P-256",
      "x": "eB6T2wFY60skcvNQAQPS5l_yhCEnrwo5P6yoHIqQYxI",
      "y": "4D8LwoIvKk7di9p83_8oTMvr3VJootJKC6iL1cuJuYA"
    }
  ]
}

Generate a QR code

$ curl -s -X POST http://localhost:8080 \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "\
family_name=Salk\
&given_names=Jonas\
&date_of_birth=1914-10-28\
&first_immunization_performer=MyLocalHospital\
&first_immunization_lot_number=LN01234\
&first_immunization_vaccine_type=Pfizer\
&first_immunization_date=2021-06-01" \
  -o /tmp/qr.png

$ open /tmp/qr.png

Limitations

  • This module currently only supports certain COVID-19 immunizations; with minor modifications it could be generalized to support all COVID-19 immunizations, and even immunizations of other diseases
  • This module does not support other types of smart health cards such as those for dianoses or lab results, only immunizations
  • This module does not support chunking large input and generating multiple QR codes that can be assembled into a single smart health card; see here

License

MIT License

Similar Resources

Tools to help teams develop smart contracts on the Cardano blockchain

Tools to help teams develop smart contracts on the Cardano blockchain

toolkit-for-cardano toolkit-for-cardano simplifies the development of Cardano smart contracts by providing teams with frequently needed tasks: Build T

Dec 19, 2022

A smart contract development toolchain for Go

ethgen - A smart contract development toolchain for Go A simple yet powerful toolchain for Go based smart contract development Compile solidity contra

Sep 14, 2022

Akroma GO client - Akroma is an EVM based application development platform (smart-contracts).

Akroma Akroma is an EVM based application development platform (smart-contracts). Akroma will utilize a Masternode system, and build out an Oracle pla

Dec 11, 2022

A Binance Smart Chain client based on the go-ethereum fork

A Binance Smart Chain client based on the go-ethereum fork

Dec 31, 2022

Automation for faucet-smart with some hacks 😈

give-me-bnb Automation for https://testnet.binance.org/faucet-smart with some hacks 😈 Usage $ give-me-bnb -help Usage of give-me-bnb: -proxy string

Nov 19, 2022

A smart Hub for holding server stat

A smart Hub for holding server stat

Stat Hub A smart Hub for holding server stat δΈ­ζ–‡θ―΄ζ˜Ž | English README Overview Stat Hub is a service for collecting and displaying servers stat. Stat Hub

Aug 29, 2020

A Binance Smart Chain client based on the erigon fork

Erigon Erigon is an implementation of Ethereum (aka "Ethereum client"), on the efficiency frontier, written in Go. System Requirements Usage Getting S

Sep 17, 2022

A Gomora template for building dApps and web3-powered API and smart contract listeners

Gomora dApp A Gomora template for building dApps and web3-powered API and smart contract listeners Local Development Setup the .env file first cp .env

Feb 15, 2022

A guide to smart contract security best practices

Smart Contract Security Best Practices Visit the documentation site: https://consensys.github.io/smart-contract-best-practices/ Read the docs in Chine

Dec 27, 2022
REST API to create and interact with decks of playing cards

Cards API REST API to create and interact with decks of playing cards. Tech Stac

Jul 14, 2022
Card-encrypt - The encryption code necessary to enroll debit cards in the Palla API

?? Card RSA Encryption Thank you for choosing Palla! ?? In this repository you'l

Jul 15, 2022
Smart.go is a pure Golang library to access disk low-level S.M.A.R.T. information

Smart.go is a pure Golang library to access disk low-level S.M.A.R.T. information. Smart.go tries to match functionality provided by smartctl but with golang API.

Dec 27, 2022
This repository holds supplementary Go cryptography libraries

Go Cryptography This repository holds supplementary Go cryptography libraries. Download/Install The easiest way to install is to run go get -u golang.

Dec 30, 2021
An interoperable smart contract hub
An interoperable smart contract hub

Juno An interoperable smart contract hub which automatically executes, controls or documents a procedure of relevant events and actions according to t

Jan 1, 2023
DERO: Secure, Anonymous Blockchain with Smart Contracts. Subscribe to Dero announcements by sending mail to [email protected] with subject: subscribe announcements
DERO: Secure, Anonymous Blockchain with Smart Contracts.  Subscribe to Dero announcements by sending mail to lists@dero.io with subject: subscribe announcements

Welcome to the Dero Project DERO News Forum Wiki Explorer Source Twitter Discord Github Stats WebWallet Medium Table of Contents ABOUT DERO PROJECT DE

Dec 7, 2022
The bare metal Go smart card
The bare metal Go smart card

Authors Andrea Barisani [email protected] | [email protected] Introduction The GoKey application implements a USB smartcard in pure Go

Dec 8, 2022
Yet another Binance Smart Chain client based on TrustFi Network

TrustFi Smart Chain The goal of TrustFi Smart Chain is to bring programmability and interoperability to Binance Chain. In order to embrace the existin

Mar 27, 2021
The Fabric Smart Client is a new Fabric Client that lets you focus on the business processes and simplifies the development of Fabric-based distributed application.

Fabric Smart Client The Fabric Smart Client (FSC, for short) is a new Fabric client-side component whose objective is twofold. FSC aims to simplify th

Dec 14, 2022
Arbitrum is a Layer 2 cryptocurrency platform that makes smart contracts scalable, fast, and private.
Arbitrum is a Layer 2 cryptocurrency platform that makes smart contracts scalable, fast, and private.

Arbitrum is a Layer 2 cryptocurrency platform that makes smart contracts scalable, fast, and private. Arbitrum interoperates closely with Ethereum, so Ethereum developers can easily cross-compile their contracts to run on Arbitrum. Arbitrum achieves these goals through a unique combination of incentives, network protocol design, and virtual machine architecture.

Jan 8, 2023