Is it possible to see what type of canonicalization was used whensigned?

  • Thread starter Thread starter AK
  • Start date Start date
A

AK

Hiya,

I need to check what type of canonicalization that was used when an
XML file was signed (if any). Currently I'm trying to do it like this:

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.PreserveWhitespace = true;
xmlDoc.Load(mySignedXmlFile);
SignedXml signedXml = new SignedXml(xmlDoc);

string canonicalizationMethod=
signedXml.SignedInfo.CanonicalizationMethod;

However this returns the same result regardless of which method was
used, or even if it's not signed at all. I'm sure I'm doing something
obviously wrong here, can anyone see what?

Many thanks,

AK
 
AK said:
I need to check what type of canonicalization that was used when an
XML file was signed (if any). Currently I'm trying to do it like this:

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.PreserveWhitespace = true;
xmlDoc.Load(mySignedXmlFile);
SignedXml signedXml = new SignedXml(xmlDoc);

string canonicalizationMethod=
signedXml.SignedInfo.CanonicalizationMethod;
Try loading the signature first, as described in the MSDN:
http://msdn.microsoft.com/library/ms229950

Disclaimer: I don't know if this actually solves your problem.
 
Back
Top