batman
batman

Reputation: 5390

How do I use an old GPG key when I switch machines or work on different platforms?

I currently have "signing Git commits with GPG keys" as part of my workflow.

I'm wondering how I can use my old signature on new computers or OSes.

Upvotes: 7

Views: 4204

Answers (1)

Jens Erat
Jens Erat

Reputation: 38732

Using GnuPG, you can easily export your secret keys using

gpg -a --export-secret-keys [key-id] >key.asc

and subsequently import them on another computer (gpg --import key.asc).

Especially for signing work, using multiple subkeys for multiple machines is recommended. If one of the computers is compromised, you can easily revoke a subkey without losing certifications.

Upvotes: 13

Related Questions