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

How to Canonicalize Xml Document for Hashing

$
0
0
Hello,

Does anyone know how to do this.  The algorithm that I need to use is System.Security.Cryptography.Xml.XmlDsigExcC14NTransform and the class reference notes state the following: "You are required to create a new instance of a canonicalization transform class only when you want to manually hash an XML document or use your own canonicalization algorithm." 

An example of what I am doing and only seeing a node the describes the transformation as a result is below.

dList = dDoc.GetElementsByTagName("Forms");

if (dList.Count > 0)
{
    exclusive.LoadInnerXml(dList);                      
    dElement = exclusive.GetXml();
    dRet.hash = dElement.InnerXml;
}

Now what I am trying to do all this is for a creating a hash of the canonical xml of one child branch of an xml document.

I have an input document and want to take once brach of the tree structure and hash it.  However it has to be in an exclusive canonical form prior to gernerating the hash of it.  To my knowledge this is not generating a digital signature which is great for an example but does not show how to use the class manually to extract transformed xml.

Anything else you need to help in this please let me know.

Thanks



Viewing all articles
Browse latest Browse all 935

Trending Articles



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