W3C home > Mailing lists > Public > w3c-ietf-xmldsig@w3.org > January to March 2004

SignedInfo

From: Alexander Dimitrov <alexander@progress.inetg.bg>
Date: Mon, 22 Mar 2004 10:36:50 +0200
Message-ID: <000501c40fe8$d2d94460$a400000a@IT>
To: <w3c-ietf-xmldsig@w3.org>

Hi,
I want to ask what is aactually signed?
I think that it is the SignedInfo element, but when I sign it the produced
result seemed incorrect?

Below is an example ot my SignedInfo element and a piece of code I use to
sign the data:

<SignedInfo><CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Canonicalizati
onMethod><SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Re
ference URI="#MyDocument"><Transforms><Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transfor
m><Transform
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Tr
ansforms><DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestVal
ue>G4J2tuGKazay8hcG8hRBzQoobpg=</DigestValue></Reference></SignedInfo>

and the code is (C#):

CspParameters p=new CspParameters(1, c.PrivateKey.ProviderName,
c.PrivateKey.ContainerName);
key=new RSACryptoServiceProvider(p);
HashAlgorithm sha = new SHA1CryptoServiceProvider();
FileStream fs = new FileStream(@"D:\SignedInfoCanonical.xml.txt",
FileMode.Open);
byte[] bytes = key.SignData(fs, sha);
char[] chars = new char[500];
Convert.ToBase64CharArray(bytes, 0, bytes.Length, chars, 0);
str = new String(chars);
Console.Out.WriteLine("Signature: " + str);
Received on Monday, 22 March 2004 04:37:16 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:21:39 UTC