aboutsummaryrefslogtreecommitdiffstats
path: root/tools/card-tool.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-02-13 08:46:36 +0000
committerWerner Koch <[email protected]>2019-02-13 08:49:07 +0000
commit7e1cd2cd416f852fc039af310e3df1ce395d89a9 (patch)
tree10e09c9a4f15399f674ea055bb1c99983f0f3333 /tools/card-tool.h
parentscd: Implement decryption for PIV cards. (diff)
downloadgnupg-7e1cd2cd416f852fc039af310e3df1ce395d89a9.tar.gz
gnupg-7e1cd2cd416f852fc039af310e3df1ce395d89a9.zip
card: New command "yubikey".
* tools/card-tool-yubikey.c: New. * tools/Makefile.am (gpg_card_tool_SOURCES): Add it. * tools/card-call-scd.c (scd_apdu): Allow returning data. * tools/card-tool-misc.c (send_apdu): New. Move from gpg-card-tool.c and let it return data. Change all callers. * tools/gpg-card-tool.c (cmd_writecert): Prepend the certref with the current application type. (cmd_yubikey): New. -- This command allows listing of active applications and to enable or disable selected applications. This is in particular useful to disable the OpenPGP application so that the PIV support can easily be tested. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/card-tool.h')
-rw-r--r--tools/card-tool.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/card-tool.h b/tools/card-tool.h
index f49f253ce..f83ebf983 100644
--- a/tools/card-tool.h
+++ b/tools/card-tool.h
@@ -192,12 +192,16 @@ gpg_error_t test_get_matching_keys (const char *hexgrip);
/*-- card-tool-misc.c --*/
key_info_t find_kinfo (card_info_t info, const char *keyref);
void *hex_to_buffer (const char *string, size_t *r_length);
+gpg_error_t send_apdu (const char *hexapdu, const char *desc,
+ unsigned int ignore,
+ unsigned char **r_data, size_t *r_datalen);
/*-- card-call-scd.c --*/
void release_card_info (card_info_t info);
const char *app_type_string (app_type_t app_type);
-gpg_error_t scd_apdu (const char *hexapdu, unsigned int *r_sw);
+gpg_error_t scd_apdu (const char *hexapdu, unsigned int *r_sw,
+ unsigned char **r_data, size_t *r_datalen);
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,
@@ -218,6 +222,8 @@ gpg_error_t scd_checkpin (const char *serialno);
unsigned long agent_get_s2k_count (void);
+/*-- card-tool-yubikey.c --*/
+gpg_error_t yubikey_commands (estream_t fp, int argc, char *argv[]);
#endif /*GNUPG_CARD_TOOL_H*/