Export secret pgp key
Once you have created your own pgp key you should backup you private (secret) key. So that you can use it in the case that all your data get lost when your pc crash. In graphical application (GPG Keychain Access) that I use under OSX there is no possibility to export your own secret key. It’s just possible to export public keys from your friends and your own one.
Once again the commandline is the best friend you have. With a very short and simple command you can export all of you secret keys or just one of them.
- Export one secret key:
- Get the ID of your secret key (e.g. 83333434)
- Export this key: gpg –export-secret-keys –secret-keyring ~/.gnupg/secring.gpg 0x83333434 > mysec.sec
- Export all secret keys:
- gpg –export-secret-keys –secret-keyring ~/.gnupg/secring.gpg > allmysec.sec
That’s it!!!
However you should keep the secret key/s really secure, because everyone who has this key can sign and decrypt messages with your name. So be careful.
Tags: certificate, pgp export, sign