summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEyal Ronen <er@eyalro.net>2021-02-28 22:59:33 +0200
committerEyal Ronen <er@eyalro.net>2021-02-28 22:59:33 +0200
commit934798e6b82c711f0e877fa7a05235aa2cf2845a (patch)
treeed0db92806bdb8bc089b78ed6b9ad2cd7c08036f
parente97fdd5f6910078f128cde131f70738f4e1874a5 (diff)
added support to parse multiple persons in the green pass and to parse vaccination passport
-rw-r--r--verify.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/verify.py b/verify.py
index 0102871..6192457 100644
--- a/verify.py
+++ b/verify.py
@@ -23,6 +23,15 @@ with open("certs/RamzorQRPubKey.pem", "rb") as f:
data = json.loads(payload)
-print(f"Israeli ID Number {data['p'][0]['idl']}")
-print(f"ID valid by {data['p'][0]['e']}")
-print(f"Cert Unique ID {data['id']}")
+if data['ct'] == 1:
+ for i in range(len(data['p'])):
+ print(f"Details of person number {i+1}:")
+ print(f"\tIsraeli ID Number {data['p'][i]['idl']}")
+ print(f"\tID valid by {data['p'][i]['e']}")
+ print(f"Cert Unique ID {data['id']}")
+elif data['ct'] == 2:
+ print(f"Israeli ID Number {data['idl']}")
+ print(f"ID valid by {data['e']}")
+ print(f"Cert Unique ID {data['id']}")
+else:
+ print("Unsupported certificate type")