[Help-gnutls] verify signed data

Volker Steiß vsteiss at web.de
Mon Mar 19 01:15:19 CET 2007


Hello everybody,

I am on a project using public-private-key methods and just tried using GnuTLS for this.
I am stuck at this point and hope someone can help me out:
First I created a public private key (it's long ago, so I cant tell you how I did it exactly).
I have created a signature with gnutls_x509_privkey_sign_data(PRIV_KEY), converted it to readable text with gnutls_hex_encode() and stored the result (Data + Signature) into a file.
Now I want to verify the created data: I read the data and the signature, decode the signature with gnutls_hex_decode() and try to verify it with gnutls_x509_privkey_verify_data(PUB_KEY). But here I get return code 0, which means no success.

Verification overview:
>>>> - somecode
init_gnutls ()
...
gnutls_hex_decode (&temp, signature.data, &signature.size)
...
gnutls_x509_privkey_init (&key)
gnutls_x509_privkey_import (key, &key_datum, GNUTLS_X509_FMT_PEM)
result = gnutls_x509_privkey_verify_data (key, flags, &uid, &signature)
//result = 0
...
<<<< - end of somecode


Btw: What I realize at "gnutls_hex_decode (&temp, signature.data, &signature.size)" is that temp.size is 512 bytes and signature.size also is 512. Am I wrong when I say: It should be smaller after decoding?


Thanks in advance and
Regards
  Volker
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066






More information about the Gnutls-help mailing list