summaryrefslogtreecommitdiffstats
path: root/scd/iso7816.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2019-03-05 15:49:20 +0100
committerWerner Koch <wk@gnupg.org>2019-03-05 15:49:20 +0100
commite897e1e255ef9870dfd1639d6f4e97bdf4e83b34 (patch)
tree5571c7633161ca25697fa7222ea8ec64f50091ce /scd/iso7816.h
parentgpg: Make invalid primary key algos obvious in key listings. (diff)
downloadgnupg2-e897e1e255ef9870dfd1639d6f4e97bdf4e83b34.tar.xz
gnupg2-e897e1e255ef9870dfd1639d6f4e97bdf4e83b34.zip
scd:piv: Implement import of private keys for Yubikeys.
* scd/app-piv.c (concat_tlv_list): Add arg 'secure' and adjust callers. (writekey_rsa, writekey_ecc): New. (do_writekey): New. (do_writecert): Provide a better error message for an empty cert. (app_select_piv): Register do_writekey. * scd/iso7816.c (iso7816_send_apdu): New. * scd/app-common.h (APP_WRITEKEY_FLAG_FORCE): New. * agent/command.c (cmd_keytocard): Make the timestamp optional. * tools/card-call-scd.c (inq_writekey_parms): Remove. (scd_writekey): Rewrite. * tools/gpg-card.c (cmd_writekey): New. (enum cmdids): Add cmdWRITEKEY. (dispatch_command, interactive_loop): Call cmd_writekey. -- This has been tested with gpgsm and RSA keys. For ECC keys only partly tested using the sample OpenPGP nistp256 and nistp384 keys because gpgsm does not yet support ECC certificates and thus we can't write the certificates to the cert object after a writekey. Note that they nevertheless show up in "gpgcard list" because gpg-card searches for them in gpg and gpgsm. However, this does not work completely. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'scd/iso7816.h')
-rw-r--r--scd/iso7816.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/scd/iso7816.h b/scd/iso7816.h
index df5d25fe8..c1940ad8d 100644
--- a/scd/iso7816.h
+++ b/scd/iso7816.h
@@ -61,6 +61,11 @@ gpg_error_t iso7816_select_path (int slot,
const unsigned short *path, size_t pathlen);
gpg_error_t iso7816_list_directory (int slot, int list_dirs,
unsigned char **result, size_t *resultlen);
+gpg_error_t iso7816_send_apdu (int slot, int extended_mode,
+ int class, int ins, int p0, int p1,
+ int lc, const void *data,
+ unsigned int *r_sw,
+ unsigned char **result, size_t *resultlen);
gpg_error_t iso7816_apdu_direct (int slot,
const void *apdudata, size_t apdudatalen,
int handle_more, unsigned int *r_sw,