Hi there, I’m getting an error
"errorMessages": [
{
"type": "ERROR",
"code": "signed-properties-hashing",
"category": "CERTIFICATE_ERRORS",
"message": "Invalid signed properties hashing, SignedProperties with id='xadesSignedProperties'",
"status": "ERROR"
}
]
My code work for Sandbox account, In sandbox account I used to call Compliance API and it returning PASSED result
/compliance
but when i call Production API for invoice verification
https://gw-fatoora.zatca.gov.sa/e-invoicing/core/compliance/invoices
It returning Invalid signed properties hashing, SignedProperties with id='xadesSignedProperties error.
My xml invoice is in
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="signature">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2006/12/xml-c14n11"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"/>
<ds:Reference Id="invoiceSignedData" URI="">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
<ds:XPath>not(//ancestor-or-self::ext:UBLExtensions)</ds:XPath>
</ds:Transform>
<ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
<ds:XPath>not(//ancestor-or-self::cac:Signature)</ds:XPath>
</ds:Transform>
<ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
<ds:XPath>not(//ancestor-or-self::cac:AdditionalDocumentReference[cbc:ID='QR'])</ds:XPath>
</ds:Transform>
<ds:Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>hIKaXvk7fIhwsA3O/tBm8xHSA7Qf/pEKrA7qNNQZAbk=</ds:DigestValue>
</ds:Reference>
<ds:Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" URI="#xadesSignedProperties">
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>MzVmNzAxZmFjZWVkYzk4M2YwZGQ3YmU0OWMyNDYyNjEyNWI4MmZiMjllZmJjOTkzNmI0NTZiOTAzOTU2ZDVmZA==</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>MEQCICg+zJ50Q5FqODPnoY+Wxw58z5E7VIO3IthvEK9qwiQHAiA8IEdEoE4VudjVTDGIaKK5y4LP0GE2/1Sz/nozKvi1fw==</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>MIICHTCCAcOgAwIBAgIGAZFvLau7MAoGCCqGSM49BAMCMBUxEzARBgNVBAMMCmVJbnZvaWNpbmcwHhcNMjQwODIwMDk0NTQ0WhcNMjkwODE5MjEwMDAwWjBQMRcwFQYDVQQDDA5FR1MxLTg4NjQzMTE0NTETMBEGA1UECwwKQmluIEhhbXJhbjETMBEGA1UECgwKQmluIEhhbXJhbjELMAkGA1UEBhMCU0EwVjAQBgcqhkjOPQIBBgUrgQQACgNCAAT8oRZ5EsOuAdvZU/lfx7K8LZoEX7bftHqHUe+GZUgWhIxFlWGEAY+/kBTCNDzHqm0tY1Xne4owAec0xmtYqJQto4HGMIHDMAwGA1UdEwEB/wQCMAAwgbIGA1UdEQSBqjCBp6SBpDCBoTE6MDgGA1UEBAwxMS1RcnwyLUlPU3wzLTZmNGQyMGUwLTZiZmUtNGE4MC05Mzg5LTdkYWJlNjYyMGYxMjEfMB0GCgmSJomT8ixkAQEMDzMwMDEwMTYwMjEwMDAwMzENMAsGA1UEDAwEMDEwMDEkMCIGA1UEGgwbMDAwMCBLaW5nIEZhaGFoZCBzdCwgS2hvYmFyMQ0wCwYDVQQPDARGb29kMAoGCCqGSM49BAMCA0gAMEUCIC/Kxw7k6e/3LIqValF3YqExHExtw8lD3gW6WKpcCI8BAiEA4QxF9cinS/s9giwNBY7tP9zFdVSfSAw882+meLW+1SA=</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<ds:Object>
<xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Target="signature">
<xades:SignedProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Id="xadesSignedProperties">
<xades:SignedSignatureProperties>
<xades:SigningTime>2022-08-17T17:41:08</xades:SigningTime>
<xades:SigningCertificate>
<xades:Cert>
<xades:CertDigest>
<ds:DigestMethod xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue xmlns:ds="http://www.w3.org/2000/09/xmldsig#">NzQzMWFlNmY1YmQwMmRmNDYwYmZiODI0ODI2ODVmNTE0NjdhMWJjNjc3ZWYyMWZlMzMyMmE2ZDZhYjI0YzAwNA==</ds:DigestValue>
</xades:CertDigest>
<xades:IssuerSerial>
<ds:X509IssuerName xmlns:ds="http://www.w3.org/2000/09/xmldsig#">CN=eInvoicing</ds:X509IssuerName>
<ds:X509SerialNumber xmlns:ds="http://www.w3.org/2000/09/xmldsig#">1724147149755</ds:X509SerialNumber>
</xades:IssuerSerial>
</xades:Cert>
</xades:SigningCertificate>
</xades:SignedSignatureProperties>
</xades:SignedProperties>
</xades:QualifyingProperties>
</ds:Object>
</ds:Signature>
I am using this github library, your help is appreciated!
Thanks