Skip to main content

Scriptable green pass verifier

Project description

Green Pass Verifier

Codacy Badge Codacy Badge Coverage Github Action Workflow PyPi greenpass Docker greenpass

A verified green pass

Scriptable green pass verifier. With this application you can automatize accesses based on green pass validity. It can also be used to analyze your digital certification (e.g. to print which key was used to sign the certificate, --verbose).

It is compatibile with EU certificates (DGC) and UK certificate (NHS).

Installation

You need to have pip and libzbar to install the application.

You can install it using your favorite package manager, for instance in Ubuntu:

sudo apt install python3-pip libzbar0

You can just install the application using pip:

pip install greenpass

If you want to install it from sources, install the python3 requirements using the following command:

pip3 install -r requirements.txt

You can also use it through the pre-built Docker image, you can find it here. You can easily use it using:

sudo docker run --rm -ti berdav/greenpass --settings

Usage

You can feed the application with different file formats, for instance:

Green pass official PDFs

greenpass --pdf greenpass.pdf

QRCode images in PNG

greenpass --qr greenpass.png

Txt files with the content of the qrcode

greenpass --txt greenpass.txt

Standard input and pipes

zbarimg --raw greenpass.png | greenpass --txt -

On a side note, you can verify camera-acquired images if your scanner prints the raw content of the QRcode on stdout

zbarcam --raw -q1 | greenpass --txt -

The application returns an UNIX compatible code, therefore you can concatenate commands that will be executed only if the green pass is verified.

greenpass --qr greenpass.png && echo "green pass ok"

You can also get the expiration configuration using --settings without other inputs.

greenpass --settings

Settings screen

Debug the cryptographic part of your greenpass

greenpass --qr greenpass.png --dump-sign

Print the key which the greenpass was signed with

greenpass --qr greenpass.png --verbose --no-cache

Check if a greenpass was valid or will be valid on a certain date

greenpass --qr greenpass.png --at-date '2021-10-30 18:34'

Switches

-h --help

Help, print the help message

You need to use one of:

--settings

Dump the settings used by the Italian application

--qr QR

Analyze the qrcode QR

--pdf PDF

Analyze the pdf file PDF

--txt TXT

Analyze the txt file TXT

Caching options:

--cachedir CACHEDIR

Use CACHEDIR as the cache directory, by default the cache is placed in $HOME/.local/greenpass.

Miscellaneous switches:

--raw

Print the raw content (JSON) of the certificate

--no-color

Disable colored output.

--force-color

Force colored output. (useful in CMD on Windows)

--no-cache

Disable cache, download everything without saving it.

--clear-cache

Redownload the entire cache, useful to update settings.

--key KEY

Use the content of the file KEY as the public certificate (DGC) or the public key (NHS) to verify the certificate.

--verbose

Print more information (e.g. which key verifies the certificate).

--dump-sign

Print details on the headers and signature of the certificate.

--at-date AT_DATE 

Use AT_DATE instead of the current date

--recovery-expiration

The recovery certification contains an expiration date. By default this date is ignored, this switch re-enables the check and consider this date (in addition to the settings date).

--batch

Remove all the outputs.

--language LANGUAGE

Localize the output in LANGUAGE. Currently the following languages are available:

  • English
  • Italian
  • German

Docker Container

The docker image shipped with the program can be used in the following way:

zbarimg --raw qrcode.png | sudo docker -i greenpass

Read a PNG greenpass qrcode

sudo docker -i greenpass --settings

To read the settings

And virtually with all the switches you can find in the previous section. At the moment, files are not easily passed in the container, therefore it is better to process the qrcode or the pdf outside of the container and extract the qrcode text to pass in the application.

Pointers

If you want more information on the green pass certification and how to parse or verify it you can refer to the following resources:

Greenpass Encoding documentation

Official Italian Android application

JSON schema and specifications

A very detailed blog post on how decode the pass

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

greenpass-4.3.1.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

greenpass-4.3.1-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file greenpass-4.3.1.tar.gz.

File metadata

  • Download URL: greenpass-4.3.1.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for greenpass-4.3.1.tar.gz
Algorithm Hash digest
SHA256 d9b9b64ae6ac3ff2f4baf71884d335a9b7025212a55367e77ab82f2af66b3f2e
MD5 b80bde57b4b6c000682551a19455aae7
BLAKE2b-256 cdecf7a60e5af5cacd0caf168259ccc01be249a7e6b4ee3d3a620bc746205162

See more details on using hashes here.

File details

Details for the file greenpass-4.3.1-py3-none-any.whl.

File metadata

  • Download URL: greenpass-4.3.1-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for greenpass-4.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7229495c55be7183f47512f2f6341a52a488e6f72e415d3a7e83bd271aff911
MD5 37baba9dd894a1843e1b68c936c9cf49
BLAKE2b-256 d9e611353fcbc28a20febe854e581273c18fcc80099290e093a71b0332b41ac4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page