XmlDsigC14NTransform framework 1.0 vs 1.1. Bug?

A

A programmer

Hi,

I have been using XmlDsigC14NTransform class and I am getting different
result with framework 1.1 and framework 1.0. It looks like the 1.1 version
handles newlines between elements differently - it replaces newline
charaacter (ASCII) 10 with escaped version -

This means, that XML digital signatures, created with one version of the
framework are invalid with the other one!

Any ideas?

Bye,
Matej

static byte[] CreateC14NXml()
{

XmlDsigC14NTransform t=new XmlDsigC14NTransform(false);
XmlDocument doc=new XmlDocument();

// load XML:
doc.Load("xml.xml");

t.LoadInput(doc);
byte[] ret;
// copy output to byte array
using (Stream s=(Stream) t.GetOutput(typeof(Stream)))
{
s.Position=0;
ret=new byte[s.Length];
if (s.Read(ret,0,(int)s.Length)!=s.Length)
throw new Exception("Error while reading C14N stream!");
}
return ret;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top