Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: devel

GPGME: Exporting private OpenPGP keys

 

 

GnuPG devel RSS feed   Index | Next | Previous | View Threaded


mario.lenz at gmx

Jul 12, 2006, 12:09 PM

Post #1 of 7 (2500 views)
Permalink
GPGME: Exporting private OpenPGP keys

Hi!

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
working on this at the moment, I'd like to give it a try and write one-
if that's ok for you. (I won't promise anything, though ;-)

cu

Mario


PS I'm on the right mailing list, am I?


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


sadam at CLEMSON

Jul 12, 2006, 2:27 PM

Post #2 of 7 (2345 views)
Permalink
Re: GPGME: Exporting private OpenPGP keys [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mario Lenz wrote:
> 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>

Cheers,

Adam Schreiber
- --
Why isn't all of your email protected?
http://gnupg.org
http://enigmail.mozdev.org
http://seahorse.sourceforge.net
http://live.gnome.org/Seahorse
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEtWlfjU1oaHEI4wgRAvI1AJ4rJbyOjqozR0BFNQSb9XIANzphIgCgu0K7
2G9tHaNcCIJZCRYItSc3gQY=
=zo3p
-----END PGP SIGNATURE-----

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


mario.lenz at gmx

Jul 13, 2006, 1:36 PM

Post #3 of 7 (2344 views)
Permalink
Re: GPGME: Exporting private OpenPGP keys [In reply to]

Hi!

> > 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");

to:

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
solution.

Mario


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


wk at gnupg

Jul 13, 2006, 2:28 PM

Post #4 of 7 (2319 views)
Permalink
Re: GPGME: Exporting private OpenPGP keys [In reply to]

On Wed, 12 Jul 2006 21:09, Mario Lenz said:

> 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
> working on this at the moment, I'd like to give it a try and write one-

Exporting private keys is not in the domain of gpgme. Management of
private keys requires specialized (organizational) processes.
Further, the way private keys are exported is very application
specific and we can't easily come up with an abstract API for
that. Thus we don't intend to support this in gpgme.

Salam-Shalom,

Werner


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


marcus.brinkmann at ruhr-uni-bochum

Jul 13, 2006, 4:17 PM

Post #5 of 7 (2348 views)
Permalink
Re: GPGME: Exporting private OpenPGP keys [In reply to]

At Thu, 13 Jul 2006 22:36:29 +0200,
Mario Lenz <mario.lenz [at] gmx> wrote:
> 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");
>
> to:
>
> 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.

This would be how to do it. In fact, I think the reserved parameter
was for this purpose, I think. However from the TODO:

** New features requested by our dear users, but rejected or left for
later consideration:
*** Allow to export secret keys.
Rejected because this is conceptually flawed. Secret keys on a
smart card can not be exported, for example.

Note that the trend for the gpg suite goes towards putting more and
more secret-key related stuff into gpg-agent and friends, away from
gpg. The idea is that handling the really sensitive data should be
done in as much of a contained space as possible. Imagine the secret
key would be managed by gpg-agent, and that there would be a way to
export it (ie, it is not a smart card). Then the path through GPGME
would be (square brackets [] denote a process)

(key repository ->) [gpg-agent] -> [gnupg] -> [gpgme -> application]

whereas application would often include several other layers, like
libqt for input/output, or libglib for storage allocation.

These are three processes at least, and at least one of them, the
application, will very likely not handle secure memory at all (take a
look at pinentry how difficult it is to use mix secure memory and a
GUI application). Another one, gnupg, would not need to run with
secure memory in this model if secret key exports were not allowed
(that's the reason why we move this stuff to gpg-agent).

I do understand that there is another consideration, and that is that
users want to be able to do key management using their favourite email
program, and that this includes making backups of secret keys. In
GPA, we do the same, by calling gnupg directly. And yes, it would be
preferable to use a GPGME interface.

So, if you still think it is a good idea, and if Werner does not
object too strongly, I think I would accept such a patch that you
propose, just because it is a small change, and it is something that
many people want to do and because they are going to do it anyway, and
if they do it it's better to do it via GPGME. But at least we need to
make it very clear in the documentation what the limits and caveats
are.

Thanks,
Marcus


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


mario.lenz at gmx

Jul 14, 2006, 9:31 AM

Post #6 of 7 (2339 views)
Permalink
Re: GPGME: Exporting private OpenPGP keys [In reply to]

> Exporting private keys is not in the domain of gpgme. Management of
> private keys requires specialized (organizational) processes.
> Further, the way private keys are exported is very application
> specific and we can't easily come up with an abstract API for
> that. Thus we don't intend to support this in gpgme.

OK, I'll have a look at seahorse and try to write my own exporting
function. Thanks for the info :-)


cu

Mario


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


sadam at CLEMSON

Jul 16, 2006, 7:09 AM

Post #7 of 7 (2336 views)
Permalink
Re: GPGME: Exporting private OpenPGP keys [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mario Lenz wrote:
> OK, I'll have a look at seahorse and try to write my own exporting
> function. Thanks for the info :-)

Mario,

I believe the function is in libseahorse/seahorse-gpgmex-op.c. If not
it's in one of the other seahorse-gpgmex-*.c files.

Cheers,

Adam
- --
Why isn't all of your email protected?
http://gnupg.org
http://enigmail.mozdev.org
http://seahorse.sourceforge.net
http://live.gnome.org/Seahorse
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEukiyjU1oaHEI4wgRAj/UAKCgswkougM1JF554y76ZpaP3F35FwCdGRLI
exwaEo1Oc6ktxoAnkrQ3Wo0=
=iF0i
-----END PGP SIGNATURE-----

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

GnuPG devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.