KMail/gpg: Difference between revisions

From KDE UserBase Wiki
m (Add Language Navigation Bar)
m (Add privacy category)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|KMail/gpg}}
<languages />
<translate>


You can use kmail and gpg to send encrypted or digitally signed mail. To do this, there are the buttons "sign" and "encrypt" in the kmail compose window. It appears if you click on "File|New|New message".
<!--T:1-->
__TOC__
[[Image:Kgpg.png]] You can use '''kmail''' and '''gpg''' to send encrypted or digitally signed mail. To do this, there are the buttons "sign" and "encrypt" in the '''kmail''' ''compose window''. It appears if you click on <menuchoice>File -> New -> New message</menuchoice>.


= Overview: GPG =
<!--T:16-->
{{Tip|1=[[Special:myLanguage/KMail/PGP_MIME|The PGP_MIME page]] will talk you through setting up and using GnuPG}}


A [http://en.wikipedia.org/wiki/Web_of_trust web of trust] are a lot of persons who trust each other. To show their trust, they have signed each other's keys. gpg allows you to do this.
== Overview: GPG == <!--T:2-->


<!--T:3-->
A [http://en.wikipedia.org/wiki/Web_of_trust web of trust] comprises a group of persons who trust each other. To show their trust, they have signed each other's keys. '''gpg''' allows you to do this.
<!--T:4-->
The web of trust is extended in key signing parties that go like this:
The web of trust is extended in key signing parties that go like this:
* you ([email protected]) meet John Foo ([email protected]) who is already a member of the web of trust
* you ([email protected]) meet John Foo ([email protected]) who is already a member of the web of trust
* you install gpg
* you install '''gpg'''
* you have a private/public key pair or generate it with  
* you have a private/public key pair or generate one with {{Input|1=gpg --gen-key}}
gpg --gen-key
Your private key is stored in "secring.gpg", your public one is stored in "pubring.gpg". You keep your private key secure, and are free to distribute your public key.
Your private key is stored in secring.gpg, your public one is stored in pubring.gpg. You keep your private key and are free to distribute your public key.
* you find out your key's fingerprint (name)
* you find out your key's name
{{Input|1=gpg --list-keys
gpg --list-keys
  /home/me/.gnupg/pubring.gpg
  /home/me/.gnupg/pubring.gpg
  ----------------------------------
  ----------------------------------
  pub  1024D/'''''45E377BB''''' 2008-02-03
  pub  1024D/'''''45E377BB''''' 2008-02-03
  [...]
  [...]}}
* you upload your public key to your key server
* you upload your public key to your key server {{Input|1=gpg --send-key}}
gpg --send-key
* John downloads your key from the key server {{Input|1=gpg --search-key me@home}}
* John downloads your key from the key server
* John checks your passport and signs your key {{Input|1=gpg --sign-key ''45E377BB''}}
gpg --search-key me@home
* John uploads your key again {{Input|1=gpg --send-key ''45E377BB''}}
* John controls your passport and signs your key
gpg --sign-key ''45E377BB''
* John uploads your key again
gpg --send-key ''45E377BB''
* You are now part of the web of trust and your public key is on the key server.
* You are now part of the web of trust and your public key is on the key server.


= How to... =
== How to... == <!--T:5-->


== Import a saved keyring ==
=== Import a saved keyring === <!--T:6-->
If you have a keyring saved to your disk, reload ("import") it like this:
If you have a keyring saved to your disk, reload ("import") it like this: {{Input|1=cat secring.skr {{!}} gpg --import}}
cat secring.skr | gpg --import   #yours may be called 'secring.pub'
{{Note|1=yours may be called 'secring.pub'}}
Then call kgpg and set your trust on your private key to ultimate.
Then call '''kgpg''' and set your trust on your private key to "ultimate."


= TroubleShooting =
== TroubleShooting == <!--T:7-->


<!--T:8-->
Whatever problems arise, first make sure your gpg is properly set up:
Whatever problems arise, first make sure your gpg is properly set up:
* List your keys
* List your keys {{Input|1= gpg --list-keys}}
gpg --list-keys
** Has to deliver something like a sensible list of keys.
: Has to deliver something like a sensible list of keys.
* Check the output of {{Input|1= gpg --update-trustdb}}
** In case of a problem look at the below.


* Check the output of
=== No ultimately trusted keys found === <!--T:9-->
gpg --update-trustdb
If {{Input|1= gpg --update-trustdb}}
: In case of a problem look at the below.
 
== no ultimately trusted keys found ==
If  
gpg --update-trustdb
delivers
delivers
gpg: no ultimately trusted keys found
{{Output|1= gpg: no ultimately trusted keys found}}
Call kgpg and set the trust of your private key to '''ultimate'''.
Call '''kgpg''' and set the trust of your private key to "ultimate'"


=="Gpg does not seem to be running..."==
==="Gpg does not seem to be running..."=== <!--T:10-->
You get an error message like this whenever you start up?  You need scripts to make it start and stop cleanly.  You can get scripts here:
You get an error message like this whenever you start up?  You need scripts to make it start and stop cleanly.  You can get scripts here:


<!--T:11-->
* https://fedorahosted.org/kde-settings/browser/trunk/etc/kde/env/gpg-agent-startup.sh
* https://fedorahosted.org/kde-settings/browser/trunk/etc/kde/env/gpg-agent-startup.sh


<!--T:12-->
* https://fedorahosted.org/kde-settings/browser/trunk/etc/kde/shutdown/gpg-agent-shutdown.sh
* https://fedorahosted.org/kde-settings/browser/trunk/etc/kde/shutdown/gpg-agent-shutdown.sh


<!--T:13-->
Copy them into your ~/.kde/env and ~/.kde/shutdown folders, check permissions, and make sure they are executable.
Copy them into your ~/.kde/env and ~/.kde/shutdown folders, check permissions, and make sure they are executable.
===Still not working?=== <!--T:14-->
Check which '''pinentry''' packages you have installed.  You may find you are missing '''pinentry-qt4'''.
== Other Key Considerations == <!--T:17-->
<!--T:18-->
From time to time you need to do some maintenance work on your keys.  [[Special:myLanguage/KGpg|KGpg]] was written to make this easier.  There you will be able to [[Special:myLanguage/KGpg#Extending_the_life_of_your_keys|extend the life of your keys]], refresh them if they have already expired, [[Special:myLanguage/KGpg#Change_your_passphrase|change your passphrase]], or [[Special:myLanguage/KGpg#Revoking_a_key|revoke a compromised key]].
<!--T:15-->
[[Category:Internet]]
[[Category:Privacy]]
</translate>

Latest revision as of 23:12, 28 February 2019

You can use kmail and gpg to send encrypted or digitally signed mail. To do this, there are the buttons "sign" and "encrypt" in the kmail compose window. It appears if you click on File -> New -> New message.

Tip

The PGP_MIME page will talk you through setting up and using GnuPG


Overview: GPG

A web of trust comprises a group of persons who trust each other. To show their trust, they have signed each other's keys. gpg allows you to do this.

The web of trust is extended in key signing parties that go like this:

  • you ([email protected]) meet John Foo ([email protected]) who is already a member of the web of trust
  • you install gpg
  • you have a private/public key pair or generate one with
    gpg --gen-key

Your private key is stored in "secring.gpg", your public one is stored in "pubring.gpg". You keep your private key secure, and are free to distribute your public key.

  • you find out your key's fingerprint (name)
gpg --list-keys
 /home/me/.gnupg/pubring.gpg
 ----------------------------------
 pub   1024D/45E377BB 2008-02-03
 [...]
  • you upload your public key to your key server
    gpg --send-key
  • John downloads your key from the key server
    gpg --search-key me@home
  • John checks your passport and signs your key
    gpg --sign-key 45E377BB
  • John uploads your key again
    gpg --send-key 45E377BB
  • You are now part of the web of trust and your public key is on the key server.

How to...

Import a saved keyring

If you have a keyring saved to your disk, reload ("import") it like this:

cat secring.skr | gpg --import

Note

yours may be called 'secring.pub'

Then call kgpg and set your trust on your private key to "ultimate."

TroubleShooting

Whatever problems arise, first make sure your gpg is properly set up:

  • List your keys
    gpg --list-keys
    • Has to deliver something like a sensible list of keys.
  • Check the output of
    gpg --update-trustdb
    • In case of a problem look at the below.

No ultimately trusted keys found

If

gpg --update-trustdb

delivers

gpg: no ultimately trusted keys found

Call kgpg and set the trust of your private key to "ultimate'"

"Gpg does not seem to be running..."

You get an error message like this whenever you start up? You need scripts to make it start and stop cleanly. You can get scripts here:

Copy them into your ~/.kde/env and ~/.kde/shutdown folders, check permissions, and make sure they are executable.

Still not working?

Check which pinentry packages you have installed. You may find you are missing pinentry-qt4.

Other Key Considerations

From time to time you need to do some maintenance work on your keys. KGpg was written to make this easier. There you will be able to extend the life of your keys, refresh them if they have already expired, change your passphrase, or revoke a compromised key.