Xmldsig Countersignature DigestValue



Hi!
How can i calculate DigestValue for Reference to signature ( ...
uri="#signatureId" ...)?
I try this code:

xmlElement - signature from xml file;
SignedXml signature = new SignedXml();
signature.LoadXml((XmlElement)xmlElement);
Transform t = new
System.Security.Cryptography.Xml.XmlDsigC14NTransform();
XmlDocument doc = new XmlDocument();
doc.PreserveWhitespace = true;
doc.LoadXml(signature.GetXml().OuterXml);
System.IO.Stream s = null;
t.LoadInput(doc);
SHA1 sha1 = SHA1.Create();
byte[] digestValue = t.GetDigestedOutput(sha1);
MessageBox.Show(Convert.ToBase64String(digestValue));

Calculated digestValue is not the same, which is in reference
digestValue in countersignature after signing.
Can anyone help me calculate this digestValue?
Iguana

.



Relevant Pages

  • Re: Xmldsig Countersignature DigestValue
    ... How can i calculate DigestValue for Reference to signature (... ... it also returns xml header. ... In that case you'll have problems verifying signature created anywhere ...
    (microsoft.public.dotnet.security)
  • Re: Xmldsig Countersignature DigestValue
    ... How can i calculate DigestValue for Reference to signature (... ... all whitespaces, significant or not, must be ... All open source or Java implementations of XML signatures follows this ...
    (microsoft.public.dotnet.security)
  • Re: Xmldsig Countersignature DigestValue
    ... fine (with my code I verify signature have generated in java - ... // get signature to countersign ... Transform t1 = new ... DigestValue is wrong (in code with two transformation - I have ...
    (microsoft.public.dotnet.security)
  • Re: Xmldsig Countersignature DigestValue
    ... fine (with my code I verify signature have generated in java - ... // get signature to countersign ... Transform t1 = new ... DigestValue is wrong (in code with two transformation - I have ...
    (microsoft.public.dotnet.security)
  • RE: SignedXML.CheckSignature()/CreateSignature() Alternative?
    ... Probably I can create a dummy reference and get the digest values for the ... the signature Value logic... ... and attach this transform to that reference. ... >> Iam using SignedXML.CheckSignaturemethod for validating XMLDSIG ...
    (microsoft.public.dotnet.security)