WARNING This library is still under development and intended for experimental purposes only.
python3 ./webcam_capture_QR_code.py | python3 ./covid-certificate-qr-decoder.py
-
The
webcam_capture_QR_code.py
script is a QR-code scanner. It turns on your webcam, waits for you to show it a QR-code, decodes it, extracts the data, prints it out, and exits. If your QR-code is a COVID vaccination certificate, the output will be a base45 string that you can recognize by theHC1:
prefix. -
The
covid-certificate-qr-decoder.py
script can decode a COVID vaccination certificate base45 string (recognizable by theHC1:
prefix), decompress the data, decode it again as a COSE message based on the CBOR tag, deserialize the resulting bytestring, print it out, and exit. This script works in pair with its best buddy scriptwebcam_capture_QR_code.py
.
- Clone the repository.
- Install dependencies:
python3 -m pip install -r requirements.txt
Launch one or the other script, or both, or any of them in combination with other shell commands:
# scan a QR-code with your webcam and pipe the base45 string to the decoder:
python3 ./webcam_capture_QR_code.py | python3 ./covid-certificate-qr-decoder.py
# or decode any base45 string:
echo 'HC1:.........' | python3 ./covid-certificate-qr-decoder.py
# IMPORTANT NOTE: if you use BASH, the base45 string must be enclosed in single —not double— quotes, as we don't want BASH to interpret $ as a special character.
# or scan any QR-code with your webcam:
python3 ./webcam_capture_QR_code.py
- API spec:
- Test data:
- Encode data into a new COVID Certificate base45 string:
- COVID certificate examples: