GPGME: Exporting private OpenPGP keys

Mario Lenz mario.lenz at
Thu Jul 13 22:36:29 CEST 2006


> > I need to export OpenPGP keys. As far as I can see it's possible to
> > export public keys, but I miss a function for private ones. If no one is
> Seahorse has a function that uses gpg --armor --export-secret-key <key>

Is there a reason why this function isn't part of GPGME? If it's just
because you havn't had time yet: I would do it. I had a look at it and
it seems that the easiest way would be to change:

if (reserved) return gpg_error (GPG_ERR_INV_VALUE);
err = add_arg (gpg, "--export");


if (reserved == 0) err = add_arg (gpg, "--export");
else if (reserved == 1) err = add_arg (gpg, --export-secret-keys");
else return gpg_error (GPG_ERR_INV_VALUE);

in functions gpg_export and gpg_export_ext (both gpgme/rungpg.c). Of
course, you would loose the reserved parameter.

But I would even sit down and write new functions if you don't like this


More information about the Gnupg-devel mailing list