--list-secret-keys and stdout
wk at gnupg.org
Mon Mar 19 09:40:17 CET 2007
On Sat, 17 Mar 2007 13:09, buanzo at buanzo.com.ar said:
> Is there an undocument way of saving that information to a file? If not, would you implement
> --output support for --list-secret-keys? Should I implement it, and send you a patch? Any other
No, there is no such option. Eventually we will add this but it needs
quite some work because we can't use the standard stdio printf for
some reasons (we need an emulation of funopen).
I wonder why you are not using gpgme - it takes care of all this and
listing the secret keys is the just a matter of:
err = gpgme_op_keylist_start (ctx, NULL, 1);
while (!(err = gpgme_op_keylist_next (ctx, &key)))
/* Now check key flags or do whatever you want to do with that
key. E.g: */
fprintf (stderr, "Key has been revoked\n");
if (gpg_err_code (err) != GPG_ERR_EOF)
err = gpgme_op_keylist_end (ctx);
This also allows to switch to X.509 keys with just one function call.
Further you automagically participate from newer developments, like
running gpg as a co-process.
More information about the Gnupg-devel