immediately create the revocation certificate. If your private key is stolen or lost, this revocation certificate can be used to notify others that your public key should no longer be used. But you can still use your revoked public key to verify signatures with which a document is signed earlier.
To create the revocation certificate, use the following command:
# gpg --output revoke-cer.asc --gen-revoke <user-id>
Store the revocation certificate in a different place than your master key-pair.
How to list GPG keys?
PGP has a concept of the keyring. To communicate with a group of people, you need to have their public keys in your keyring.
To list the GPG keys in your public keyring, type the following command:
# gpg --list-keys
Initially, this will list only your keys. Once you import someone else’s public key to your keyring, it will list that too.
How to export GPG public key?
You need to export your public key to be able to share it with others so that others can add the public key to their keyrings. To export your public key in a file, use the following command:
# gpg --output public-key.asc --export <user-id>
This exports the key in binary format, which is inconvenient at times. To export the key in ASCII-armored format, use the –armor option.
# gpg --armor --output public-key.asc --export <user-id>
This will represent the key in ASCII format. Once you open the file of an exported public key in ASCII armored format, it will show some readable characters, though they are encrypted.
How to export GPG private key?
You can export your private key and keep it in a safe place. You can use the following command for that purpose:
# gpg --armor --output private-key.asc --export-secret-key <user-id>
Please make sure you keep it in a safe place and never ever share it with others.
How to import a GPG public key in your keyring?
To communicate with someone, you would need to import her public key to your keyring first. To import someone’s public key to your keyring type the following command:
# gpg --import pub-key-jake.asc
If you now list the keys in your keyring using the –list-keys option, it will show the imported key.
I hope this helps. Interested readers who want to know more about how different cryptographic algorithms and Public Key Infrastructure work may want to refer to the book “Cryptography And Public Key Infrastructure.”






0 Comments