Mailing List Archive

How to migrate my key from card to file?
Hi list,

I did search but did not find a useful answer to my question. In 2017
someone else asked:

> During generating the keys on the GnuPG card, one can (and should)
> create some backup of the secret key into a file. It is totally
> unclear to me how to make something usefull out of this file, for
> example import it into a "normal" secret keyring to use it in case of
> the GnuPG card gets lost.

The discussion that followed explained how to create another CARD based
key from the backup. That is NOT my concern, I know how to do this.
Thus, I'd like to put this more specifically:

I want to no longer use a card (e.g. in order to be able to read old
messages on a mobile device, or in Thunderbird 78.2.1 WITHOUT the use of
GnuPG) but want to use the OLD CARD KEY.

I did create the key "on card"* (with --card-edit/admin/generate, NOT as
plain file and then with --keytocard). I do have a private_stub.gpg,
pubkey.gpg and sk_xxx.gpg.

*As I read in the above thread, the code actually generates the key as a
file, writes out a backup file and transfers it to the card. So maybe
I'd rather have used file based creation+backup-my-key+keytocard in the
first place, but I did not.

My question: Now that I have the above three files (and a working card
with the secret key on it), how can I use these to create a plain file
based private+public keypair from it?

Regards
Olav

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: How to migrate my key from card to file? [ In reply to ]
On Sun, 6 Sep 2020 01:24, Olav Seyfarth said:

> private_stub.gpg, pubkey.gpg and sk_xxx.gpg.

The pubkey and the sk_KEYID.gpg is all you need but unfortunately there
is no tool support to create a file from it. It would require a little
bit of hacking to do this with the current code base.

The feature I would propose here is a way to create a
private-keys-v1.d/xxx.key file from a sk_KEYID.gpg file. It should not
be too much work and I can imagine that this will go into 2.3.

Can you please do me a favor and open a feature request at dev.gnupg.org
?


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.