0

I'm signing xml document with x509Certificate in .net. If I verify signature in .net with signedXml.CheckSignature function the signature is ok. If I try to check the same signature in java i always get java.lang.RuntimeException: Wrong Signature: Wrong Signature. Anyone has experience with that?

public static bool verifyXMLSignature(XmlDocument ADoc, string ACertificateSerial) { X509Certificate2 cert = null; cert = podpisi.getCertificate(ACertificateSerial); // Create a new SignedXml object and pass it // the XML document class. SignedXml signedXml = new SignedXml(ADoc); // Find the "Signature" node and create a new // XmlNodeList object. XmlNodeList nodeList = ADoc.GetElementsByTagName("Signature"); // Load the signature node. signedXml.LoadXml((XmlElement)nodeList[0]); // Check the signature and return the result. return signedXml.CheckSignature(cert, true); } 

1 Answer 1

1

The code you posted is the working c# code - the non-working code is the Java code which has not been posted. Knowing your Java code would allow us to point out where your problem may be located in the code...

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.