smartcards and GPGME

Dirk Gottschalk dirk.gottschalk1980 at
Mon May 14 02:53:26 CEST 2018

Hello Jacob.

Am Sonntag, den 13.05.2018, 18:26 -0400 schrieb Jacob Adams:
> Hello all,
> As part of a program I'm writing this summer for GSoC, I'd like to be
> able to both move gpg private keys to a smartcard and generate keys
> on
> the smartcard from an application. While this can be done from gpg,
> it
> doesn't look like I can do so from GPGME or any other wrappers that
> exist. Have I missed something or is this simply not possible yet?

GPGsm does not do anything with GPG keys directly. The Keys it creates
are stored inside GPGsm and are derived from GPG keys, AFAIU.

For your purpose you have to use the GPGme library.

> While I could wrap this functionality of gpg, I'd really prefer not
> to
> and I'd rather not drop the user to a gpg prompt if I don't have to.

GPGme does what you are trying to do, without prompting, except for
cases where PIN or password are required. This events are handled by

GPGsm is for managing X.509 certificates. I'm not sure if it can handle
moved keys. It should, if it interaqcts with gpg-agent. That's
something I'm not really sure of.


Dirk Gottschalk
Paulusstrasse 6-8
52064 Aachen
Tel.: +49 1573 1152350
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the Gnupg-users mailing list