signing message problem
marcus.brinkmann at ruhr-uni-bochum.de
Wed Aug 9 08:37:37 CEST 2006
At Tue, 08 Aug 2006 22:38:17 +0200,
Hajdu Péter <hp489 at hszk.bme.hu> wrote:
> I've got a problem while signing message with gpgme. I'm really new to
> gpgme, so please be patient. Here is my code:
> error = gpgme_op_sign( context, message, signature,
> GPGME_SIG_MODE_NORMAL );
> printf("%s\n",gpg_strerror( error ));
You need to rewind the file pointer here:
gpgme_data_seek (signature, 0, SEEK_SET);
> printf("%d\n",gpgme_data_read( signature, buf, sizeof(buf) ));
> That's not the entire code, I've cut out error handling.
As a side note, it's recommended (by me :) to always send small, but
complete examples, ie files that compile, and with error handling.
This allows others to reproduce the problem easier. In this case, I
could see the mistake immediately, but this is not always the case.
More information about the Gnupg-devel