aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gpgme.texi
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-06-25 01:44:50 +0000
committerWerner Koch <[email protected]>2008-06-25 01:44:50 +0000
commitd0fe86179c28493a0b282acb0101c829f8a35820 (patch)
tree09fd5d9163a94b94655469e632b468514435e0ad /doc/gpgme.texi
parentUpdated the example. (diff)
downloadgpgme-d0fe86179c28493a0b282acb0101c829f8a35820.tar.gz
gpgme-d0fe86179c28493a0b282acb0101c829f8a35820.zip
Updated example.
Diffstat (limited to 'doc/gpgme.texi')
-rw-r--r--doc/gpgme.texi11
1 files changed, 8 insertions, 3 deletions
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index b5fba15b..2b96d873 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -2772,6 +2772,7 @@ and e-mail address of the main user ID:
@example
gpgme_ctx_t ctx;
+gpgme_key_t key;
gpgme_error_t err = gpgme_new (&ctx);
if (!err)
@@ -2782,15 +2783,19 @@ if (!err)
err = gpgme_op_keylist_next (ctx, &key);
if (err)
break;
- printf ("%s: %s <%s>\n", key->keyid, key->name, key->email);
+ printf ("%s:", key->subkeys->keyid);
+ if (key->uids && key->uids->name)
+ printf (" %s", key->uids->name);
+ if (key->uids && key->uids->email)
+ printf (" <%s>", key->uids->email);
+ putchar ('\n');
gpgme_key_release (key);
@}
gpgme_release (ctx);
@}
if (gpg_err_code (err) != GPG_ERR_EOF)
@{
- fprintf (stderr, "%s: can not list keys: %s\n",
- argv[0], gpgme_strerror (err));
+ fprintf (stderr, "can not list keys: %s\n", gpgme_strerror (err));
exit (1);
@}
@end example