using Zatca.EInvoice.SDK;
using Zatca.EInvoice.SDK.Contracts.Models;
XmlDocument xml = new XmlDocument();
xml.Load(“File.xml”);
EInvoiceSigner eInvoiceSigner = new EInvoiceSigner(); SignResult signResult = eInvoiceSigner.SignDocument(xml, CSID, PrivateKey);
xml = signResult.SignedEInvoice
//when test xml file in ``sandbox.zatca.gov.sa/TestXML
//if this Invoice Standard Valid OK
//If This Invoice Simplified Valid Error
//Valid : false
//Errors
//category : QR_CODE_ERROR
//code : hashedXml
//message : hashedXml does not match with qr code hashedXml or the hashedXml is missing
//category : SIGNATURE_ERROR
//code :invoiceSignedDataDigestValue
//message : wrong invoice hashing
//category : SIGNATURE_ERROR
//code :X509IssuerName
//message : wrong X509Issuer
//category : SIGNATURE_ERROR
//code :X509SerialNumberyour text
//message : wrong X509SerialNumber
//category : SIGNATURE_ERROR
//code :signatureValue
//message : wrong signature Value
Mahmoud Ismaeil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.