Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

SignedXML.CheckSignature Always Fails

$
0
0
I don't think I posted my original question in the correct forum, so I'm going to close that one and post here.

I'm currently working on a project which requires the XML posts to be digitally signed. I do not seem to have any luck with getting any test posts from our client to validate with the below code:

publicstaticbool verifySignature(string xmlData)

{



    XmlDocument theDocument = new XmlDocument();

    XmlNodeList nodeList;

    SignedXml signedDocument;



    theDocument.PreserveWhitespace = true;

    theDocument.LoadXml(xmlData);

    signedDocument = new SignedXml(theDocument);



    nodeList = theDocument.GetElementsByTagName(

        "ds:Signature");



    signedDocument.LoadXml((XmlElement)nodeList[0]);



     return signedDocument.CheckSignature();



}


The posts are signed using the XML Signature tag with a namespace of "ds". I am simply base64 decoding the post and sending it straight to here without any modifications of whitespace or casing.

Any help would be greatly appreciated!

- Jake

Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>