summaryrefslogtreecommitdiffstats
path: root/tools/gpg-card.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-01-16 21:28:45 +0100
committerWerner Koch <wk@gnupg.org>2020-01-16 21:28:45 +0100
commitbd85f9232ad639d4acba443272147c4fc01b1b65 (patch)
tree834ec0308c89077102341e4ec492de6f8cd5841a /tools/gpg-card.h
parentscd: New commands SWITCHCARD and SWITCHAPP. (diff)
downloadgnupg2-bd85f9232ad639d4acba443272147c4fc01b1b65.tar.xz
gnupg2-bd85f9232ad639d4acba443272147c4fc01b1b65.zip
card: Allow switching of cards and applications.
* tools/card-call-scd.c (struct card_cardlist_parm_s): Add field with_apps. (card_cardlist_cb): Handle the new with_apps flag. (scd_switchcard): New. (scd_switchapp): New. (scd_applist): New. (scd_serialno): Pass --all also in --demand mode. * tools/gpg-card.c (cmd_list): Simplify switching of cards. Add switching of alls. Print a list of apps per card. -- Note that the output format of "list --card" slightly changes: The current card is indicated with an asterisk. That should not harm any robust parsers which might already be in use. It is anyway a development version. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'tools/gpg-card.h')
-rw-r--r--tools/gpg-card.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/gpg-card.h b/tools/gpg-card.h
index 35db14d25..c6f73405f 100644
--- a/tools/gpg-card.h
+++ b/tools/gpg-card.h
@@ -204,6 +204,10 @@ const char *app_type_string (app_type_t app_type);
gpg_error_t scd_apdu (const char *hexapdu, unsigned int *r_sw,
unsigned char **r_data, size_t *r_datalen);
+
+gpg_error_t scd_switchcard (const char *serialno);
+gpg_error_t scd_switchapp (const char *appname);
+
gpg_error_t scd_learn (card_info_t info);
gpg_error_t scd_getattr (const char *name, struct card_info_s *info);
gpg_error_t scd_setattr (const char *name,
@@ -214,10 +218,12 @@ gpg_error_t scd_writekey (const char *keyref, int force, const char *keygrip);
gpg_error_t scd_genkey (const char *keyref, int force, const char *algo,
u32 *createtime);
gpg_error_t scd_serialno (char **r_serialno, const char *demand);
+
gpg_error_t scd_readcert (const char *certidstr,
void **r_buf, size_t *r_buflen);
gpg_error_t scd_readkey (const char *keyrefstr, gcry_sexp_t *r_result);
gpg_error_t scd_cardlist (strlist_t *result);
+gpg_error_t scd_applist (strlist_t *result, int all);
gpg_error_t scd_change_pin (const char *pinref, int reset_mode);
gpg_error_t scd_checkpin (const char *serialno);