I am developing a .Net application to onboard Invoices to ZATCA using SDK’s .Net library in step of Signing Standard invoice I am using following commands/methods
.Net method:
eInvoiceSigner.SignDocument(eInvoice, certificateContent, privateKeyContent).SaveSignedEInvoice(xmlFilePath)
CLI : fatoora -sign -qr -invoice .\Standard_Invoice_.xml -signed .\Standard_Signed.xml
both generates SignedXML file corrected with EInvoice Hash,Signature,Hash and ParseCertificate embeded in xml file but the invoiceHash in DigestValue of CLI generated file is valid and gives 200 status on compliance check . whereas .Net method generated invoice throws Error:The invoice hash API body does not match the (calculated) Hash of the XML . both are same XML files not even single word is modified.
Possibile issue is .NET eInvoiceSigner.SignDocument(eInvoice, certificateContent, privateKeyContent).SaveSignedEInvoice(xmlFilePath)
method is using Windows Line endings (CR ,LF) or ((\r\n) and encoding=“utf-8”? while CLI fatoora cmd uses Linux Line endings (LF,\n) and encoding=“UTF-8”? (its capital) these are the only changes but I can assure you in my input file I am sending it with “UTF-8” and “\n” only
Anyone who is able to use .Net Library correctly to generate signed invoice which passes compliance check please help me