[xmlsec] Different digest value between .NET implementation and XmlSec?

Chugh, Sanjay schugh at filenet.com
Thu Oct 9 12:53:21 PDT 2003

Hello, I am in the middle of learning all this business about XmlDigital
signatures and Encryption.
To try and understand things, I've been trying different libraries and
trying to verify results.
I have run into one issue that I was wondering if somebody could shed
some light into.
I have the XML file shown at the bottom of the e-mail.
When I calculate a signature using XmlSec, the digest value generated

However, when I calculate a signature on the same file using .NET, the
digest value is different:

I have tracked it down to the following. The XmlSec library is
calculating the digest on the canonicalized form without the procession
<?xml-stylesheet type="text/xsl" href="myfile.xsl" ?>

at the top of the file. The .NET implementation includes the processing
instruction in it's calculation of the digest. According to what I have
read, I believe that .NET is correct to include the processing
instruction in it's calculation of the digest.
Does anyone know why this should be the case?
-- Sanjay
Here is the Xml file:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="myfile.xsl" ?>
<!DOCTYPE sales [
<!ELEMENT sales (region*)>
<!ATTLIST sales quarter CDATA #IMPLIED>
<!ELEMENT region (units, amount)>
<!ATTLIST region name ID #IMPLIED>
<!ELEMENT units (#PCDATA) >
<!ELEMENT amount (#PCDATA) >
<sales quarter="2001-01">
   <region name="Northeast">
   <region name="Southeast">
   <region name="Southwest">
   <region name="Northwest">

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.aleksey.com/pipermail/xmlsec/attachments/20031009/1c5a3ff7/attachment.htm

More information about the xmlsec mailing list