backup & restore private key without kleopatra


I am using portable version of GPG4Win (Version 2.x). It is a non-install binary ready to be used, doesn’t have kleopatra.

Now, how can export(backup) & import(restore) my private key in case of disaster recovery?

are there any gpg2 command line options? I tried normal --export-secret-key & --import, but the imported key is unusable, meaning it has “sec#” when I list the private keys.

Please help!!!


Just for completeness: With kleopatra the procedure is documented here:

I believe without it, you can just backup the public and secret keyrings.

Or if you must use --export-secret-key you also need to export and import the
public certificate as well. (As far as I remember.)

Thanks for the reply.

What is the use of maintaining a back-up if I am unable to use the secret key in any manner.

I wonder if --export-secret-key has any use at all?

Thanks :“This is normally not very useful and a security risk.”

You can use it, but you will have to import the corresponding public certificate separately (AFAIR).

Found another hack on net,

Thanks for following up and posting the link. That’s an interesting way to do it. Seems to work in cmd.exe as well using the “type” command in place of “cat”.