Hi! I have implemented entire RFC3161 (Time Stamp Protocol) with csharp, .net 2.0, VC 2005, for timestamping signatures with TSA. My problem is extract and get from SignedXml.Signature.SignatureValue hash, which must be send in request to TSA. I have spent lot of time on this, but cant see how extract hash from xml signature. Is it posible with cryptography library from .net? Please for help, Iguana
Hello Getting hash from byte array is, sha1managed sha=new sha1managed(); byte[] hash=sha.computeHash(to-be-hashed); That's all. to-be-hashed is a byte array or stream. You may want SignatureValue there. There are also another hash algorithms like sha and MD5. This example is just sha1. [quoted text, click to view] "Iguana" <szewczykw@zetokatowice.pl> wrote in message news:1179226464.494784.207710@n59g2000hsh.googlegroups.com... > Hi! > I have implemented entire RFC3161 (Time Stamp Protocol) with > csharp, .net 2.0, VC 2005, for timestamping signatures with TSA. > My problem is extract and get from SignedXml.Signature.SignatureValue > hash, which must be send in request to TSA. > I have spent lot of time on this, but cant see how extract hash from > xml signature. > Is it posible with cryptography library from .net? > Please for help, > Iguana >
[quoted text, click to view] On May 15, 12:54 pm, Iguana <szewcz...@zetokatowice.pl> wrote: > Hi! > I have implemented entire RFC3161 (Time Stamp Protocol) with > csharp, .net 2.0, VC 2005, for timestamping signatures with TSA. > My problem is extract and get from SignedXml.Signature.SignatureValue > hash, which must be send in request to TSA. > I have spent lot of time on this, but cant see how extract hash from > xml signature. > Is it posible with cryptography library from .net? > Please for help, > Iguana
Hi, to get hash of signed xml you have to: - extract signedinfo element; - serialize it with explicit cannonical form; - calculate hash; - verify that signature of given hash is valid; you don't extract hash from signature, you validate your hash. -Valery
On 18 Maj, 07:18, Valery Pryamikov <valery.pryami...@q-free.com> [quoted text, click to view] wrote: > On May 15, 12:54 pm,Iguana<szewcz...@zetokatowice.pl> wrote: > > > Hi! > > I have implemented entire RFC3161 (Time Stamp Protocol) with > > csharp, .net 2.0, VC 2005, for timestamping signatures with TSA. > > My problem is extract and get from SignedXml.Signature.SignatureValue > >hash, which must be send in request to TSA. > > I have spent lot of time on this, but cant see how extracthashfrom > > xml signature. > > Is it posible with cryptography library from .net? > > Please for help, > >Iguana > > Hi, > to gethashof signed xml you have to: > - extract signedinfo element; > - serialize it with explicit cannonical form; > - calculatehash; > - verify that signature of givenhashis valid; > > you don't extracthashfrom signature, you validate yourhash. > > -Valery
Hi Valery! Thanks for post - very helpful! I calculate hash - but cant see method to check signature with calculated hash? Can Youe explain how validate calculated hash? Iguana
[quoted text, click to view] On 21 Maj, 14:10, Iguana <szewcz...@zetokatowice.pl> wrote: > On 18 Maj, 07:18, Valery Pryamikov <valery.pryami...@q-free.com> > wrote: > > > > > > > On May 15, 12:54 pm,Iguana<szewcz...@zetokatowice.pl> wrote: > > > > Hi! > > > I have implemented entire RFC3161 (Time Stamp Protocol) with > > > csharp, .net 2.0, VC 2005, for timestamping signatures with TSA. > > > My problem is extract and get from SignedXml.Signature.SignatureValue > > >hash, which must be send in request to TSA. > > > I have spent lot of time on this, but cant see how extracthashfrom > > > xml signature. > > > Is it posible with cryptography library from .net? > > > Please for help, > > >Iguana > > > Hi, > > to gethashof signed xml you have to: > > - extract signedinfo element; > > - serialize it with explicit cannonical form; > > - calculatehash; > > - verify that signature of givenhashis valid; > > > you don't extracthashfrom signature, you validate yourhash. > > > -Valery > > Hi Valery! > Thanks for post - very helpful! > I calculatehash- but cant see method to check signature with > calculatedhash? > Can Youe explain how validate calculatedhash?Iguana- Ukryj cytowany tekst= - > > - Poka=BF cytowany tekst -
I try RSAPKCS1SignatureDeformatter, but always method CheckSignature(hash, signatureValue) return false - signaturer is not valid. Any sugestion will be helpful, Iguana
[quoted text, click to view] On 21 Maj, 15:23, Iguana <szewcz...@zetokatowice.pl> wrote: > On 21 Maj, 14:10,Iguana<szewcz...@zetokatowice.pl> wrote: > > > > > > > On 18 Maj, 07:18, Valery Pryamikov <valery.pryami...@q-free.com> > > wrote: > > > > On May 15, 12:54 pm,Iguana<szewcz...@zetokatowice.pl> wrote: > > > > > Hi! > > > > I have implemented entire RFC3161 (Time Stamp Protocol) with > > > > csharp, .net 2.0, VC 2005, for timestamping signatures with TSA. > > > > My problem is extract and get from SignedXml.Signature.SignatureVal= ue > > > >hash, which must be send in request to TSA. > > > > I have spent lot of time on this, but cant see how extracthashfrom > > > > xml signature. > > > > Is it posible with cryptography library from .net? > > > > Please for help, > > > >Iguana > > > > Hi, > > > to gethashof signed xml you have to: > > > - extract signedinfo element; > > > - serialize it with explicit cannonical form; > > > - calculatehash; > > > - verify that signature of givenhashis valid; > > > > you don't extracthashfrom signature, you validate yourhash. > > > > -Valery > > > Hi Valery! > > Thanks for post - very helpful! > > I calculatehash- but cant see method to check signature with > > calculatedhash? > > Can Youe explain how validate calculatedhash?Iguana- Ukryj cytowany tek= st - > > > - Poka cytowany tekst - > > I try RSAPKCS1SignatureDeformatter, but always method > CheckSignature(hash,signatureValue) return false - signaturer is not > valid. > Any sugestion will be helpful,Iguana- Ukryj cytowany tekst - > > - Poka=BF cytowany tekst -
My faul - everything works perfect! Thanks for everyone for help! Iguana
Don't see what you're looking for? Try a search.
|