Hy!

I am creating a signed xml document using:

XmlDocument objdoc=new XmlDocument();
objdoc.Load("test.xhtml");
DataObject dObj=new DataObject();
dObj.Id="xmldsig-dataobj";
dObj.Data=objdoc.ChildNodes;
Reference dRef=new Reference("#xmldsig-dataobj");
SignedXml xmlsig=new SignedXml();
xmlsig.AddObject(dObj);
xmlsig.AddReference(dRef);
RSA rsa=new RSASignatureCard(SigCard);
KeyInfo keyinfo=new KeyInfo();
keyinfo.AddClause(new RSAKeyValue(rsa));
xmlsig.KeyInfo=keyinfo;
xmlsig.SigningKey=rsa;
xmlsig.ComputeSignature();

(RSASignatureCard is a self-written class derived from RSA which uses a
smartcard)

This works fine, the signature can be calculated and is also verified
correctly.
But if I look at the data that has actually been signed
via             rsa.EncryptValue(xmlsig.Signature.SignatureValue);
the digest that can be found there is different from the one residing in

sigref=xmlsig.Signature.SignedInfo.References[0] as Reference;
sigref.DigestValue;
                                                                        Weird, 
isn't it?

cheers
Mathias

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to