Home GnuPG
Diffusion GnuPG d3f5d8544fdb

gpg: Extend --quick-gen-key for creating keys from a card.

Description

gpg: Extend --quick-gen-key for creating keys from a card.

* g10/keygen.c (parse_key_parameter_part): Add arg R_KEYGRIP and
support the special algo "card".
(parse_key_parameter_string): Add args R_KEYGRIP and R_SUBKEYGRIP.
Handle the "card" algo.  Adjust callers.
(parse_algo_usage_expire): Add arg R_KEYGRIP.
(quickgen_set_para): Add arg KEYGRIP and put it into the parameter
list.
(quick_generate_keypair): Handle algo "card".
(generate_keypair): Also handle the keygrips as returned by
parse_key_parameter_string.
(ask_algo): Support ed25519 from a card.

Note that this allows to create a new OpenPGP key from an initialized
OpenPGP card or from any other supported cards. It has been tested
with the TCOS Netkey card. Right now a stub file for the cards might
be needed; this can be achieved by running "gpgsm --learn" with the
card plugged in.

Example:

gpg --quick-gen-key foo@example.org card
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Aug 22 2019, 4:37 PM
Parents
rGb3226d91d045: gpg: Use modern spelling for the female salutation.
Branches
Unknown
Tags
Unknown
Tasks
T4681: Allow non-OpenPGP cards with gpg 2.2