aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app-common.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-03-05 14:49:20 +0000
committerWerner Koch <[email protected]>2019-03-05 14:49:20 +0000
commite897e1e255ef9870dfd1639d6f4e97bdf4e83b34 (patch)
tree5571c7633161ca25697fa7222ea8ec64f50091ce /scd/app-common.h
parentgpg: Make invalid primary key algos obvious in key listings. (diff)
downloadgnupg-e897e1e255ef9870dfd1639d6f4e97bdf4e83b34.tar.gz
gnupg-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 <[email protected]>
Diffstat (limited to 'scd/app-common.h')
-rw-r--r--scd/app-common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/scd/app-common.h b/scd/app-common.h
index 97274a7cb..2404086e9 100644
--- a/scd/app-common.h
+++ b/scd/app-common.h
@@ -33,6 +33,9 @@
/* Flags used with app_genkey. */
#define APP_GENKEY_FLAG_FORCE 1 /* Force overwriting existing key. */
+/* Flags used with app_writekey. */
+#define APP_WRITEKEY_FLAG_FORCE 1 /* Force overwriting existing key. */
+
/* Bit flags set by the decipher function into R_INFO. */
#define APP_DECIPHER_INFO_NOPAD 1 /* Padding has been removed. */