[PATCH GnuPG 1/2] scd:piv: Keep the public key if a key import fails

Ingo Klöcker kloecker at kde.org
Thu Nov 12 16:29:01 CET 2026


On Donnerstag, 12. November 2026 10:22:05 Mitteleuropäische Normalzeit David 
Seifert via Gnupg-devel wrote:
> Clearing is not needed: writekey_rsa and writekey_ecc overwrite the
> cert DO with the new public key after the card accepted the key.
> do_genkey does the same.

What happens when overwriting the cert DO fails? Do you then have a public key 
on the card which doesn't match the private key on the card? Isn't that worse 
than losing the public key on a failed import. You should have made a backup 
of the public key anyway. (How to get the backup of the public key back on the 
card is another story.)

Regards
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 265 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20261112/a73dee10/attachment.sig>


More information about the Gnupg-devel mailing list