Closed Henje closed 3 years ago
Hey @Henje, thank you for the bug report. Would you mind sharing which country issued your DCC? I'll try to reproduce this issue with test certs for me to understand it a bit better.
My personal certificate is from Germany. An example which uses the same encoding can be found in https://github.com/Digitaler-Impfnachweis/covpass-ios/blob/ede7190605ec0b2209336d8d5a0624e7ac1547ff/Source/CovPassCommon/Tests/CovPassCommonTests/Helpers/CertificateMock.swift#L12. If need by, I could also send you my personal certificate, but the linked one shows the same behaviour.
I tested your validator with my personal certificate and got the error that "The DCC is not in a supported format, so the validity cannot be verified." This issue comes from the fact that your code assumes the
kid
is located in the protected part of the WebToken. In my case thekid
is located in the unprotected part.The spec says: "The Key Identifier is not a security-critical field. For this reason, it MAY also be placed in an unprotected header if required. Verifiers MUST accept both options. If both options are present, the Key Identifier in the protected header MUST be used."
A simple change to make it work would be: