Skip to content

Instantly share code, notes, and snippets.

@lysender
Created July 1, 2020 03:35
Show Gist options
  • Save lysender/2dbab9ee6913fb3b6d54f0764a5554c2 to your computer and use it in GitHub Desktop.
Save lysender/2dbab9ee6913fb3b6d54f0764a5554c2 to your computer and use it in GitHub Desktop.
Export and import GPG Keys

Export public key

gpg --export your_address@example.net > my_key.pub 

The file can then be shared to other people.

Export public key in armor ascii format

gpg --armor --export YOUR_KEY_ID_HERE

This text can then be used on Github for example to verify commits.

Export secret key

gpg --output mygpgkey_sec.gpg --armor --export-secret-key ABCDFE01

Import public and secret keys on the other machine

gpg --import ~/mygpgkey_pub.gpg
gpg --allow-secret-key-import --import ~/mygpgkey_sec.gpg
@Maxiferado
Copy link

it was really usefull for me, thanks!

@jpolivra
Copy link

That help me a lot, thank you!

@NextArcadia
Copy link

The information I needed was concise and very helpful. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment