HighTechTalks DotNet Forums  

KeyInfo.GetXml() in SignedXml

Dotnet Security microsoft.public.dotnet.security


Discuss KeyInfo.GetXml() in SignedXml in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?TWFyaWFu?=
 
Posts: n/a

Default 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...

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.