Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XAdES - CertDigest element

1,280 views
Skip to first unread message

jacek...@gmail.com

unread,
May 17, 2008, 5:42:53 AM5/17/08
to
Hi,
I have a question about XAdES CertDigest element. Site:
http://www.w3.org/TR/XAdES/#Syntax_for_XAdES_The_SigningCertificate_element
tells:
"The element CertDigest contains the digest of one of the certificates
referenced in the sequence. It contains two elements: DigestMethod
indicates the digest algorithm and DigestValue contains the value of
the digest."

I want to manually compute digest value but I don't know which data I
should choose.
XmlDsigC14NTransform class has a method GetDigestedOutput() but I
can't find anything about LoadInput data.

Thanks in advance.
JB

Jeancc

unread,
Jun 10, 2008, 11:23:01 AM6/10/08
to
Hi from Spain,

you can load the certificate into an X509Certificate2 object, for example
using a BinaryReader object. Later, you can generate the hash:

X509Certificate2 x509=new X509Certificate2();

//now you have to load the certificate into the object, reading from a file
//Read the help for loading X509 certificates from files. For example, the
//method Import of X509Certificate2 object ;-D.

SHA1 sha=new SHA1CryptoServiceProvider();
byte[] hash;
hash=sha.ComputeHash(x509.RawData);

Try!!

JB

unread,
Jun 19, 2008, 4:05:07 AM6/19/08
to
Thanks a lot Jeancc.

On 10 Cze, 17:23, Jeancc <Jea...@discussions.microsoft.com> wrote:
> Hi from Spain,
>
> you can load the certificate into an X509Certificate2 object, for example
> using a BinaryReader object. Later, you can generate the hash:
>
> X509Certificate2 x509=new X509Certificate2();
>
> //now you have to load the certificate into the object, reading from a file
> //Read the help for loading X509 certificates from files. For example, the
> //method Import of X509Certificate2 object ;-D.
>
> SHA1 sha=new SHA1CryptoServiceProvider();
> byte[] hash;
> hash=sha.ComputeHash(x509.RawData);
>
> Try!!
>
>
>
> "jacek.bu...@gmail.com" wrote:
> > Hi,
> > I have a question about XAdES CertDigest element. Site:

> >http://www.w3.org/TR/XAdES/#Syntax_for_XAdES_The_SigningCertificate_e...


> > tells:
> > "The element CertDigest contains the digest of one of the certificates
> > referenced in the sequence. It contains two elements: DigestMethod
> > indicates the digest algorithm and DigestValue contains the value of
> > the digest."
>
> > I want to manually compute digest value but I don't know which data I
> > should choose.
> > XmlDsigC14NTransform class has a method GetDigestedOutput() but I
> > can't find anything about LoadInput data.
>
> > Thanks in advance.

> > JB- Ukryj cytowany tekst -
>
> - Pokaż cytowany tekst -

Message has been deleted

pauloto...@gmail.com

unread,
Jul 28, 2018, 2:07:14 PM7/28/18
to
Hi! JB

Did you solve the problem? How did you calculate DigestValue of XAdES CertDigest element?

I have the same problem.

Thanks!
Message has been deleted
0 new messages