From 9905cca620c5a94392758a72f34189e6c95c83b0 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 17 Mar 2021 12:01:59 +0200 Subject: Update README --- README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d265970..cf8e65d 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,25 @@ pipenv sync ### Usage -#### Option 1 - from QR code image +Generate a Green Pass or Vaccination Certificate at https://corona.health.gov.il/green-pass/ -Save your Green Pass as a `.png` file and execute: +#### Option 1 - from PDF + +Directly verify your `GreenPass.pdf` or `VaccinationCertificate.pdf`: + +```bash +pipenv run verify -p GreenPass.pdf +``` + +#### Option 2 - from QR code image + +Save the QR code as a `.png` file (e.g. from screenshot) and execute: ```bash pipenv run verify -i green_pass_image.png ``` -#### Option 2 - from QR code decoded textual content +#### Option 3 - from QR code decoded textual content Decode the QR code payload yourself, put it in a txt file and then execute: @@ -37,10 +47,10 @@ pipenv run verify -t green_pass_payload.txt ### Output example ``` -Valid signature! Israeli ID Number 012345678 ID valid by 2021-01-01 Cert Unique ID 01/IL/ABCD1234ABCD1234ABCD1234ABCD1234#ABCD1234 +Valid signature! ``` ## Verification Process Details @@ -59,6 +69,8 @@ Where `Base64EncodedSignature` are 256 bytes of an RSA signature signed with a 2 ⚠️ **The current MOH implementation has a pitfall.** ⚠️ The JSON payload is not signed as is, but rather the **SHA256 hash** of the data is signed. This effectively means the payload is hashed twice, once manually, and once as part of the signature verification scheme. +Some certificates now have `ct=2` which is not double hashed. This implementation supports both versions. + ### Certificates The Ministry of Healthy RSA certificate seems to be available at https://ramzorfiles.z6.web.core.windows.net/RamzorQRPubKey.der -- cgit v1.3.1