1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

card: Print the key's label if available.

* tools/gpg-card.h (struct key_info_s): Add field 'label'.
* tools/card-call-scd.c (learn_status_cb): Parse KEY-LABEL.
(scd_learn): Always request KEY-LABEL.
* tools/gpg-card.c (nullnone): New.
(list_one_kinfo, list_card): Use it.  Print the label.
--

PKCS#15 defines label which help to understand for what a key is
intended.  Print them.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2021-03-30 17:28:45 +02:00
parent 7f91263632
commit 0d6f276f61
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 60 additions and 8 deletions

View file

@ -125,6 +125,9 @@ struct key_info_s
const char *keyalgo;
enum gcry_pk_algos keyalgo_id;
/* An optional malloced label for the key. */
char *label;
/* The three next items are mostly useful for OpenPGP cards. */
unsigned char fprlen; /* Use length of the next item. */
unsigned char fpr[32]; /* The binary fingerprint of length FPRLEN. */