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); }