Use gpg smart card

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

Import public key from keyserver

gpg --keyserver pgp.mit.edu --recv 655685AC

Import from smartcard

bk201@edge:~$ gpg --card-edit
gpg: detected reader `German Privacy Foundation Crypto Stick v1.2 00 00'
# more card stuff
URL of public key : x-hkp://pgp.mit.edu <1>
gpg/card> fetch
gpg: requesting key 655685AC from hkp server pgp.mit.edu
# import message
gpg/card> quit

1: if keyserver is set, public key can be fetched automatically

Check private key

To verify if the private key from the smartcard is usable use the --list-secret option.

bk201@edge:~$ gpg --list-secret
# nothing here
bk201@edge:~$ gpg --card-status
# smartcard accessed
bk201@edge:~$ gpg --list-secret
sec>  2048R/655685AC 2011-02-04
      Card serial no. = 0005 0000088E
uid                  Tan-Vinh Nguyen ...
ssb>  1024R/3072C7C4 2011-02-04
ssb>  2048R/766C78D0 2011-02-04
Please remember the terms for blog comments.