You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue when using the signxml to valid XML documents, specifically during the signing process. The problem arises with the namespace being generated for the element, causing validation to fail.
Problem Description:
When signing an XML document using the XMLSigner function, the generated element looks like this:
However, when attempting to validate the signed XML, the following error is returned:
signxml.exceptions.InvalidInput: Expected to find XML element DigestMethod in {http://www.w3.org/2000/09/xmldsig#}Reference
The library expects the <DigestMethod> element to be in the {http://www.w3.org/2000/09/xmldsig#} namespace, but the generated namespace includes a suffix {http://www.w3.org/2000/09/xmldsig#sha256}.
Code Snippet
Here is the code used to generate the XML signature:
The text was updated successfully, but these errors were encountered:
GabrielIFPB
changed the title
Namespace issue for <DigestMethod> element in XML signature
Incorrect Namespace in <DigestMethod> Element during XML Signing Process
Sep 24, 2024
Hello,
I encountered an issue when using the
signxml
to valid XML documents, specifically during the signing process. The problem arises with the namespace being generated for the element, causing validation to fail.Problem Description:
When signing an XML document using the XMLSigner function, the generated element looks like this:
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
However, when attempting to validate the signed XML, the following error is returned:
signxml.exceptions.InvalidInput: Expected to find XML element DigestMethod in {http://www.w3.org/2000/09/xmldsig#}Reference
The library expects the
<DigestMethod>
element to be in the{http://www.w3.org/2000/09/xmldsig#}
namespace, but the generated namespace includes a suffix{http://www.w3.org/2000/09/xmldsig#sha256}
.Code Snippet
Here is the code used to generate the XML signature:
When validating the signed XML, the following code is used:
Steps to Reproduce
Use the XMLSigner function with the following options:
Sign an XML document using an X.509 certificate.
Attempt to validate the signed XML using the XMLVerifier() function:
An error will be raised indicating that the element has an incorrect namespace.
Example of Generated XML
The text was updated successfully, but these errors were encountered: