Skip to content

Instantly share code, notes, and snippets.

@russau
Last active October 26, 2021 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save russau/d4720facad86b9d967236544df9ec005 to your computer and use it in GitHub Desktop.
Save russau/d4720facad86b9d967236544df9ec005 to your computer and use it in GitHub Desktop.
Extract Certificate from Vaccination QR

Getting my head around the QR codes in the International COVID-19 Vaccination Certificate. This will run in a ubuntu:20.04 container.

  • zbarimg decodes the QR
  • sed replaces out the non-json I don't want
  • jq gets the certificate from the json
  • tr convert from base64url to base64
  • openssl to dump the certificate
DEBIAN_FRONTEND=noninteractive apt-get install -y zbar-tools jq openssl
zbarimg /qr/qr.png 2>/dev/null | \
sed "s/QR-Code://" | \
jq -r .sig.cer | \
tr '_-' '/+' | \
base64 --decode | \
openssl x509 -inform der -text --noout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment