Hello,
I'd like to ask a quick question. I'm trying to verify XAdES signatures in XML documents. Some of these are signed with RSA-SHA256, while others are signed with ECDSA-SHA384.
When I use the SignedXml.CheckSignature() method, the RSA-signed signatures verify correctly and return true. However, the ECDSA-signed signatures fail verification.
Could you please provide some information on how to properly verify these ECDSA signatures? Or, if you have an article on this topic, could you please share the link?
Keep up the good work.
Best regards,
Deepika SawantPosted Oct 13, 2025, 1:21 PM
SignedXml in .NET does not natively support ECDSA verification for XML signatures, especially with algorithms like ECDSA-SHA384. You’ll need to extend or customize the verification logic.
Here's a breakdown of the issue and how to address it:
Why ECDSA Signatures Fail with
SignedXml.CheckSignature()SignedXmlclass in .NET is designed around XMLDSIG standards, which historically focused on RSA and DSA.SignedXmlimplementation does not automatically support ECDSA algorithms likehttp://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384.SignedXmldoesn’t recognize or handle the ECDSA signature algorithm URI properly during verification.How to Verify ECDSA-SHA384 Signatures in XML
To verify ECDSA signatures, you’ll need to:
1. Extend
SignedXmlto support ECDSACreate a custom class that inherits from
SignedXmland override theGetSignatureMethod()andGetHashAlgorithm()methods to handle ECDSA URIs.2. Use the custom class for verification
Make sure
publicKeyis an instance ofECDsaloaded from the certificate.Helpful Resources
SignedXml