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
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.bubak@gmail.com" wrote: > 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 > >
Thanks a lot Jeancc. On 10 Cze, 17:23, Jeancc 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 -