From 934798e6b82c711f0e877fa7a05235aa2cf2845a Mon Sep 17 00:00:00 2001 From: Eyal Ronen Date: Sun, 28 Feb 2021 22:59:33 +0200 Subject: added support to parse multiple persons in the green pass and to parse vaccination passport --- verify.py | 15 ++++++++++++--- 1 file 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") -- cgit v1.3.1