From: Andrew Engelbrecht
Use the following command to export your secret key so you can import it into your email client at the next step. To avoid getting your key compromised, store this in a safe place, and make sure that if it is transferred, it is done so in a trusted way. Exporting your keys can be done with the following commands:
-$ gpg --export-secret-keys -a keyid > my_secret_key.ascJust in case you lose your key, or it gets compromised, you want to generate a certificate and choose to save it in a safe place on your computer for now (please refer to step 6.C for how to best store your revocation cerficate safely). This step is essential for your email self-defense, as you'll learn more about in Section 5.
# Copy your keyID gnupg --list-key [your@email] will list your public ("pub") key information, including your keyID, which is a unique list of numbers and letters. Copy this keyID, so you can use it in the following command.
-# Generate a revocation certificate: gpg --output revoke.asc [keyID]
+# Generate a revocation certificate: gpg --gen-revoke --output revoke.asc [keyID] [keyID]
# It will prompt you to give a reason for revocation, we recommend to use 1 "key has been compromised"
# You don't have to fill in a reason, but you can, then press enter for an empty line, and comfirm your selection.