[GPGME] gpgme_get_key vs. gpgme_op_keylist_start

Stephan Menzel smenzel at gmx-gmbh.de
Tue May 2 16:51:37 CEST 2006


Sorry for posting this twice. Wrong address :-(

-----------------------
Hi there,

I am about to check S/MIME signatures using GPGME which already works fine.
Now I would like to get further information about a certificate which was used 
to sign a key.

As I understand the manual, the easiest way to get this is:

gpgme_key_t  key;
gpgme_get_key(_ctx, fingerprint, &key, 0)

However, this gives me always NULL in the key which means as much 
as 'fingerprint not found'

But gpgsm --list-keys shows the specific key in question!

When I try this:

gpgme_op_keylist_start(ctx, 0, 0);
while ((gpgme_op_keylist_next(ctx, &key) != GPG_ERR_EOF) && key) {
   fprintf(stderr, "key found:\n");
   fprintf(stderr, "issuer   : %s\n", key->issuer_name);
   fprintf(stderr, "serial   : %s\n", key->issuer_serial);
   fprintf(stderr, "chain id : %s\n", key->chain_id);
}

The key shows up, but I cannot see the fingerprint in this struct gpgme_key_t. 
There is only a chain ID which is different from the keys fingerprint.

So what is the difference here? Why does gpgme_get_key not give me the key?
Or am I completely wrong here?

Would you have any hint for me?

Greetings...

Stephan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
Url : /pipermail/attachments/20060502/14294c74/attachment.pgp


More information about the Gnupg-devel mailing list