Getting SmartCard key info

Werner Koch wk at
Tue May 31 09:19:14 CEST 2005

On Tue, 24 May 2005 11:34:46 +0200, Patrick Brunschwig said:

> Hello
> is there any way to find out if a secret key (or subkey) is on a smart
> card when using "gpg --with-colons --list-secret-keys" ?

> The thing is that gpg --list-secret-keys tells me the required card
> serial number, while I don't see anything in the --with-colons mode.

Hmm, it works for me:

  $ gpg -K --fixed-list-mode --with-colons heine
  uid:::::1116949944::6C83E6B54DD67DA7119882A92708B085B0324B23::Heinrich Heine <heinrichh at>:
Note that this is the full AID and not just the serialno part.  From

  15. Field   Used in sec/sbb to print the serial number of a token
              (internal protect mode 1002) or a '#' if that key is a
              simple stub (internal protect mode 1001)

--fixed-list-mode ist important and should in fact be used by all
applications.  It is available since version 1.0.5 and does not
anymore merge the first UID with the PUB line.



More information about the Gnupg-devel mailing list