Signing or encrypting messages via GPG/OpenPGP that you send.
Andre Klapper
ak-47@gmx.net
Novell, Inc

Creative Commons Share Alike 3.0

# Creating a GPG key

These steps are very technical. For average users we recommend using the Seahorse application for managing GPG/OpenPGP keys.

Before you can get or send GPG encrypted mail, you need to generate your public and private keys with GPG.

Open the Terminal application and enter gpg --gen-key.

选择一个算法，然后按“回车”。

Select a key length, then press Enter.

输入您的密钥有效期限。

键入您的真名，然后回车。

输入您的邮件地址，按回车键。

(可选)输入评论，按回车键。

查看您选择的用户ID，确认后按O。

输入一个密码短语，按回车键。

随意移动您的鼠标，生成密钥。

After the keys are generated, you can view your key information by entering gpg --list-keys. You should see something similar to this: `/home/you/.gnupg/pubring.gpg ---------------------------- pub 1024D/32j38dk2 2001-06-20 you <you@example.com> sub 1024g/289sklj3 2011-06-20 [expires: 2012-11-14]`

GPG creates one list, or keyring, for your public keys and one for your private keys. All the public keys you know are stored in the file ~/.gnupg/pubring.gpg. If you want to give other people your key, send them that file.

If you want, you can upload your keys to a key server:

Check your public key ID with `gpg --list-keys`. It is the string after `1024D` on the line beginning with `pub`. In the example above, it is `32j38dk2`.

Enter the command gpg --send-keys --keyserver wwwkeys.pgp.net 32j38dk2. Substitute your key ID for `32j38dk2`. You need your password to do this.

密钥服务器存储您的公有密钥，这样您的朋友就可以解密您的邮件。如果您不使用密钥服务器，也可以手动发送自己的公有密钥，可以把它加在签名文件中，也可以放在自己的网页上。但是，我们建议还是一次性生成一个密钥放到服务器上，让别人在需要的时候下载，这样更方便一些。

If you don't have a key to unlock or encrypt a message, you can set your encryption tool to look it up automatically. If it cannot find the key, an error message appears.