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;
}
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;
}