This page explains in detail how to obtain a GPG key using common Fedora
utilities. It also provides information on managing your key as a Fedora
contributor.
[[creating-gpg-keys]]
Creating GPG Keys
~~~~~~~~~~~~~~~~~
[[creating-gpg-keys-using-the-gnome-desktop]]
Creating GPG Keys Using the GNOME Desktop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Install the *Seahorse* utility, which makes GPG key management easier.
From the main menu, select _Applications > Add/Remove Software_. Select
the _Search_ tab and enter the name _seahorse_. Select the checkbox next
to the _seahorse_ package and select _Apply_ to add the software. You
can also install *Seahorse* using the command line with the command
`su -c "yum install seahorse"`.
To create a key, go the the Activities overview and select _Passwords
and Encryption Keys_, which starts the application *Seahorse*.
From the _File_ menu select _New..._ then _PGP Key_ then click
_Continue_. Type your full name, email address, and an optional comment
describing who you are (e.g.: John C. Smith, jsmith@example.com, The
Man). Click _Create_. A dialog is displayed asking for a passphrase for
the key. Choose a passphrase that is strong but also easy to remember.
Click _OK_ and the key is created.
To find your GPG key ID click on the _My Personal Keys_ tab and look in
the _Key ID_ column next to the newly created key. In most cases, if you
are asked for the key ID, you should prepend "0x" to the key ID, as in
"0x6789ABCD".
Now you should link:#BackupGNOME[ make a backup] of your private key.
[[creating-gpg-keys-using-the-kde-desktop]]
Creating GPG Keys Using the KDE Desktop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Start the *KGpg* program from the main menu by selecting _Utilities >
PIM > KGpg_. If you have never used *KGpg* before, the program walks you
through the process of creating your own GPG keypair.
A dialog box appears prompting you to create a new key pair. Enter your
name, email address, and an optional comment. You can also choose an
expiration time for your key, as well as the key strength (number of
bits) and algorithms. The next dialog box prompts you for your
passphrase. At this point, your key appears in the main *KGpg* window.
To find your GPG key ID, look in the _Key ID_ column next to the newly
created key. In most cases, if you are asked for the key ID, you should
prepend "0x" to the key ID, as in "0x6789ABCD".
Now you should link:#BackupKDE[ make a backup] of your private key.
[[creating-gpg-keys-using-the-command-line]]
Creating GPG Keys Using the Command Line
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use the following shell command:
....
gpg2 --full-gen-key
....
This command generates a key pair that consists of a public and a
private key. Other people use your public key to authenticate and/or
decrypt your communications. Distribute your *public* key as widely as
possible, especially to people who you know will want to receive
authentic communications from you, such as a mailing list. The Fedora
Documentation Project, for example, asks participants to include a GPG
public key in their link:DocsProject/SelfIntroduction[
self-introduction] .
A series of prompts directs you through the process. Press the *Enter*
key to assign a default value if desired. The first prompt asks you to
select what kind of key you prefer:
....
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection?
....
In almost all cases, the default is the correct choice. A RSA/RSA key
allows you not only to sign communications, but also to encrypt files.
Next, choose the key size:
....
RSA keys may be between 1024 and 4096 bits long. Larger is almost always recommended here, however your use case and security models may dictate otherwise.
What keysize do you want? (2048)
....
Again, the default is sufficient for almost all users, and represents an
_extremely_ strong level of security.
Next, choose when the key will expire. It is a good idea to choose an
expiration date instead of using the default, which is _none._ If, for
example, the email address on the key becomes invalid, an expiration
date will remind others to stop using that public key.
....
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0)
....
Entering a value of `1y`, for example, makes the key valid for one year.
(You may change this expiration date after the key is generated, if you
change your mind.)
Before the `gpg` program asks for signature information, the following
prompt appears:
....
Is this correct (y/n)?
....
Enter `y` to finish the process.
Next, enter your name and email address. _Remember this process is about
authenticating you as a real individual._ For this reason, include your
_real name_. Do not use aliases or handles, since these disguise or
obfuscate your identity.
Enter your real email address for your GPG key. If you choose a bogus
email address, it will be more difficult for others to find your public
key. This makes authenticating your communications difficult. If you are
using this GPG key for link:DocsProject/SelfIntroduction[
self-introduction] on a mailing list, for example, enter the email
address you use on that list.
Use the comment field to include aliases or other information. (Some
people use different keys for different purposes and identify each key
with a comment, such as "Office" or "Open Source Projects.")
At the confirmation prompt, enter the letter *O* to continue if all
entries are correct, or use the other options to fix any problems.
Finally, enter a passphrase for your secret key. The `gpg` program asks
you to enter your passphrase twice to ensure you made no typing errors.
Finally, `gpg` generates random data to make your key as unique as
possible. Move your mouse, type random keys, or perform other tasks on
the system during this step to speed up the process. Once this step is
finished, your keys are complete and ready to use:
....
pub 1024D/1B2AFA1C 2005-03-31 John Q. Doe (Fedora Docs Project) <jqdoe@example.com>