ehn-dcc-development / ehn-sign-verify-javascript-trivial

Trivial eHN-Simple implementation in plain/simplified javascript
European Union Public License 1.2
32 stars 12 forks source link

Error: Unknown tag, 18 #8

Open thom4parisot opened 3 years ago

thom4parisot commented 3 years ago

Hello,

Thanks for the explainer.

I have created an Observable notebook to spark conversations with people unaware of QR code contents/unable to compare them with their national QR code.

const [, unpreffixed_data] = ehc_data.split('HC1:')
const decoded_data = base45.decode(unpreffixed_data)
const uncompressed_data = zlib.inflate(decoded_data)
const decrypted_data = cose.encrypt.read(uncompressed_data)

Although, the const decrypted_data line triggers an Unknown tag, 18 error.

image

When I inspect the uncompressed_data, I observe some data structure, but I fail to read them with the cose JavaScript library (which I'm a total noob with):

Buffer.from(uncompressed_data, 'hex').toString()
// --> M�\u0004H�\u00197_�網\u0001&�Y\u00013�\u0004\u001a`�Ee\u0006\u001a`Тe\u0001bAT9\u0001\u0003�\u0001�av��bdn\u0001bmamORG-100030215bvpj1119349007bdtj2021-02-18bcobATbcix1URN:UVCI:01:AT:10807843F94AEE0EE5093FBC254BD813#BbmplEU/1/20/1528bisx\u001bMinistry of Health, Austriabsd\u0002btgi840539006cnam�cfntuMUSTERFRAU<GOESSINGERbfnuMusterfrau-GößingercgnthGABRIELEbgnhGabrielecvere1.2.1cdobj1998-02-26X@��\u0001}_���ئFc\
// to be continue (…)

Do you have any pointers? Let me know if you feel this question should rather be in a different location, or repository.

Thank you in advance for your help, and for the materials you have published online.