KeyInfo.GetXml() in SignedXml -
07-09-2007
, 05:14 AM
Hi,
I am trying to read the certificate data from signed xml. The code looks like:
XmlDocument xmlSignature = new XmlDocument();
xmlSignature.PreserveWhitespace = true;
xmlSignature.LoadXml(textBox1.Text);
SignedXml signedXml = new SignedXml();
signedXml.LoadXml((XmlElement)xmlSignature.GetElem entsByTagName("Signature")[0]);
string tmpCertB64 =
signedXml.KeyInfo.GetXml().GetElementsByTagName("X 509Certificate",
signedXml.KeyInfo.GetXml().NamespaceURI).Item(0).I nnerText;
The code throws an exception on "signedXml.KeyInfo.GetXml()" operation. The
exception says "This is an unexpected token. The expected token is
'SEMICOLON'. Line 1, position 314."
The <KeyInfo> element in <Signature> contains <X509SubjectName>, which
contains & character, of course correctly encoded '&'.
..net 2.2 KeyInfo class handle this correctly, but in .net 1.1 it seems to be
a bug, when I try to use GetXml() on KeyInfo. How can I fix this problem? Or
it would be nice to fix this generally via servicepack for .net1.1
Thank You for any help... |