List Info

Thread: Re: --list-secret-keys and stdout




Re: --list-secret-keys and stdout
user name
2007-03-19 03:40:17
On Sat, 17 Mar 2007 13:09, buanzobuanzo.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);
  fail_if_err (err);
    
  while (!(err = gpgme_op_keylist_next (ctx, &key)))
    {
      /* Now check key flags or do whatever you want to do
with that
         key.  E.g: */
      if (key->revoked)
	{
	  fprintf (stderr, "Key has been revokedn");
          gpgme_key_unref (key);
	  continue
	}
      foo (key);
      gpgme_key_unref (key);
    }
  if (gpg_err_code (err) != GPG_ERR_EOF)
    fail_if_err (err);
  err = gpgme_op_keylist_end (ctx);
  fail_if_err (err);

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.



Salam-Shalom,

   Werner


_______________________________________________
Gnupg-devel mailing list
Gnupg-develgnupg.org
h
ttp://lists.gnupg.org/mailman/listinfo/gnupg-devel

Re: --list-secret-keys and stdout
country flaguser name
Argentina
2007-03-19 05:56:20
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Werner Koch wrote:
> 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:

GPGME? From Within a Firefox Extension, when I intent to
avoid more dependencies? So far Enigform
just needs Firefox, gpg, and the extension itself. No C++
XPCOM components, etc.

Enigmail, the famous Thunderbird extension, uses the ipc js
library to capture gpg's stdout and
parse it, but the library is not that portable. :(

- --
Arturo "Buanzo" Busleiman - Consultor
Independiente en Seguridad Informatica
Foros GNU/Buanzo: Respeto, Soluciones y Buena Onda: http://foros.buanzo.com.ar

Consulting and Secure Mail Hosting: http://www.buanzo.com.a
r/pro/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFF/mxUAlpOsGhXcE0RCq/zAJ92ZlERn6JMykinbB38sPLNAFhSFgCf
YeGs
IwxsuiLhgfIPAz+uN4yBHuk=
=NSOr
-----END PGP SIGNATURE-----

_______________________________________________
Gnupg-devel mailing list
Gnupg-develgnupg.org
h
ttp://lists.gnupg.org/mailman/listinfo/gnupg-devel

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )