To create an OpenPGP key from the keys on a PIV card in Kleopatra I need quick-gen-key to work for PIV cards. Currently,
$ gpg --quick-gen-key --yes piv@example.net card
fails with
gpg: Serial number of the card: FF020001008A7796 gpg: Serial number of the card: FF020001008A7796 Key generation failed: No such file or directory
I think that's because quick_generate_keypair() makes the assumption
/* If KEYTIME is set we know that the key has been taken from the * card. Store that flag in the parameters. */ if (keytime) { r = xmalloc_clear (sizeof *r); r->key = pCARDKEY; r->u.abool = 1; r->next = para; para = r; }
For keys on PIV cards this assumption is wrong because those keys do not have a keytime.