To be able to encrypt and sign messages with the desktop client, it is necessary to have GPG keys. If you already have some available you can use those, otherwise here is how to create a new pair.
Creating GPG keys using Kleopatra
Kleopatra is a graphical application that comes with the Kontact suite, and that allows you to create a new pair of keys. The wizard can be launched in the menu under “File”->”New Certificate…”.
The default settings should suit most usecases. The only thing you might want to change is to set an expiry date in the “Advanced Settings”, in the “Valid until” field.
Creating GPG keys on the commandline
The gpg2 commandline tool can be used to create a fresh set of keys as well.
Do not use the old gpg tool to generate the key as the key will be stored in an incompatible fashion, always use gpg2.
The creation dialog can be started with:
The default settings should suit most usecases. The only thing you might want to change is to set an expiry date when asked for how long the key should be valid.
For more details please follow the RedHat documentation.
Using the key from within Kontact
To use the key go to “Settings”->”Configure Kontact”. In the “Identities” tab, edit your identity and select the created key in the “Cryptography” tab as “OpenPGP signing key” and “OpenPGP encryption key”.