Generate QR Code

Dears All,
How Can Get the value of tag7: ECDSA signature, and tag9:For Simplified Tax Invoices and there? associated notes, the ECDSA signature of
the cryptographic stamp’s public key by
ZATCA’s technical CA ?
@lalomar

Dear @lalomar ,
Can explain more , can u tell me the commands should be used to signing the invoice (standard, simplified)?

1 Like

Dear @Madleen,

B2B invoices are not required to be signed, so ZATCA will generated the QR code for you & return in inside the base64 encoded cleared XML in from the API response.

And for signing using ZATCA’s SDK, please find the steps below:
1- After sending the CSR in the Compliance request CSID API, a Binarytoken & secret will be returned
2- Take the Binarytoken output, and decode it using base64 decoder, the decoded value is the x.509 certificate
3- Go to the SDK file to the following path: SDK/Data/Certificates/Cert.pem and replacae the vaule with your obtained X509 cert.
4- replace also the private key that generated with the CSR, in the private key file.pem following this path: SDK/Data/Certificates/ec-secp256k1-priv-key.pem
5- if you are using JAVA SDK and use the command
: fatoora -sign -invoice “invoice.xml”
6- if you are using .Net SDK, use the command:
fatoorenet sign -invoice “invoice.xml”

This procedure is to follow if you are using the SDK using CLI.

thank you,

Dear @Madleen,

Please find the answers below of how to get each tag:

TAG7: Generate private key from CSR config file (you can refer to openssl commands, or readme file on SDK)
2. Sign the generated invoice hash (in SHA-256 format not encoded with base64) with ECDSA using the private key (output).
example.:MEQCIGvLa1f3uMCe0AidKUWJ5ghMiDMRcC0qO78ntcTKVOYgAiAKBkX+uuFhbIcye3JznNa45qH1twlLFu/q
PzEQ9HMNLw==

TAG9: you can decode your returened X509 certificate, to get the ECDSA signature of he cryptographic stamp’s public key. it will be in hex format, once decoded sucessfully you will be able to refer to the value under “signature algorithim: ECDSA with sha-256” And it’s the TAG9 value.