mrsool / zatca

An unofficial Ruby library for generating ZATCA e-invoices, QR Codes, and submitting e-invoices to ZATCA's servers.
MIT License
37 stars 15 forks source link

x509 certificate signature and public key extraction #17

Closed wes4m closed 1 year ago

wes4m commented 1 year ago

This is a fix for extracting public_key and signature from the signing certificates. Also switches the order of TLV tags in the QR making the certificate signature bytes be the 8th tag instead of 7th.

ZATCA docs are confusing and mention that the tag should be 7 in one page and 8 in another. However, from testing this with zatca-xml-js this order along with how the values are extracted is generating a valid signed invoice that passes compliance checks.