diff options
| author | Eyal Ronen <er@eyalro.net> | 2021-02-28 22:59:33 +0200 |
|---|---|---|
| committer | Eyal Ronen <er@eyalro.net> | 2021-02-28 22:59:33 +0200 |
| commit | 934798e6b82c711f0e877fa7a05235aa2cf2845a (patch) | |
| tree | ed0db92806bdb8bc089b78ed6b9ad2cd7c08036f /verify.py | |
| parent | e97fdd5f6910078f128cde131f70738f4e1874a5 (diff) | |
added support to parse multiple persons in the green pass and to parse vaccination passport
Diffstat (limited to 'verify.py')
| -rw-r--r-- | verify.py | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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") |
