panzi / verify-ehc

Simple Python script to decode and verify an European Health Certificate QR-code
60 stars 17 forks source link

Cert type (vaccination, test, recovery) #23

Closed GimecoRules closed 2 years ago

GimecoRules commented 2 years ago

Sorry Panzi, i cannot find in verify_ehc the kind of document to determine local rules. Could you help me please?

days_exp = 365 #for example if the certificate is 2nd injection expires_at = issued_at + timedelta(days=days_exp)

I would add if statement for 3 conditions (molecular test, 1st or 2nd injection) Thank you very much.

panzi commented 2 years ago

You want to have a look at this: https://github.com/ehn-dcc-development/ehn-dcc-schema

GimecoRules commented 2 years ago

:-( I have read all files you have shared with me, but i do not understand which parameters i have to check... Please could you help me? Does your ehc_verify program understand code type? I kindly ask to be patient, i am not an expert.

panzi commented 2 years ago

verify_ehc.py only does the cryptographic verification and does not understand the payload (i.e. whether it is test, recovery, or vaccination). If you're not a software developer it's going to be difficult for you to implement country specific rules verification. The variable ehc in this line contains the actual payload data: https://github.com/panzi/verify-ehc/blob/2d29bbe8ba89c5498b6c7f953b0cd80a83e40e25/verify_ehc.py#L2449 The format of the date is described in the link in my last comment, and e.g. information about the Austrian verification rules can be found here: https://github.com/Federal-Ministry-of-Health-AT/green-pass-overview#business-rules-validation (No idea about other countries.) I.e. you would need to download the CertLogic rules from the link provided by the Austrian government and apply those rules using a CertLogic engine onto the ehc payload. (I think it will then answer with True or False, not with why it's True or False.)

I had no time or energy to code all that myself and it would be country specific anyway.