Getting SmartCard key info

Werner Koch wk at gnupg.org
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
  sec::1024:1:586B85BE114A05E1:1116949944::::::scESCA:::D2760001240101010001000003470000:
  uid:::::1116949944::6C83E6B54DD67DA7119882A92708B085B0324B23::Heinrich Heine <heinrichh at duesseldorf.de>:
  ssb::1024:1:7CF434FA0521AD19:1116949976::::::a:::D2760001240101010001000003470000:
  ssb::1024:1:2D1D6B157FE2DF37:1116950005::::::e:::D2760001240101010001000003470000:
  
Note that this is the full AID and not just the serialno part.  From
doc/DETAILS:

  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.


Salam-Shalom,

   Werner




More information about the Gnupg-devel mailing list