panzi / verify-ehc

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

Expire day not working #22

Closed GimecoRules closed 2 years ago

GimecoRules commented 2 years ago

Hi Panzi, i have used your program. Unfortunately trying with different QRCodes the expire day is the same.

Output file greenpass.json:

Expires At : 2023-05-12T00:00:00 Issued At : Issuer : Is Expired : False ...

Please could you help me?

Thanks.

panzi commented 2 years ago

That Expires At field is part of the Cose Sign1 message. It is not the actual expiration of a vaccination/test/recovery (it's always much longer). To check if an European Health Certificate is still (or in case of an vaccination even already) valid you need to apply the rules of your country to it yourself. This is not done by this script. The rules vary from country to country and are changed all the time.

panzi commented 2 years ago

There is no medical expiry date in the EHC. There is a vaccination date, test date, infection and recovery date. Then country specific rules need to be applied to get the actual expiration date. Actually it might be more specific than per country, since e.g. Vienna has (had? I didn't keep track) different rules then the rest of Austria. See e.g. the section about the Austrian business rules here: https://github.com/Federal-Ministry-of-Health-AT/green-pass-overview#details-on-trust-listsbusiness-rulesvalue-sets That part is not implemented by this script. Don't know if I have time/energy to implement that some day.

GimecoRules commented 2 years ago

Yes, i have removed my sentence because i have understood. I will define condition from issue date / type depending on local laws. Thank you.