Startseite > English > Collect PGP keys of all your contacts from keyserver

Collect PGP keys of all your contacts from keyserver

If you like to start encrypting your Emails you need partners who are also willing to set up the PGP encryption. And then you need to exchange the public keys. For that it’s handy to upload the own public key to a key-server. If you use Thunderbird with Enigmail that’s pretty easy. Go to OpenPGP > Key Management, right klick on your own key and select Upload Keys to Keyserver. Everybody else can now query the server and get your public key.

Wouldn’t it be great to run automatically trough your address book and search for everybody who has uploaded his key to a key-server? That’s quite easy with Thunderbird and Linux:

  1. export your address book
    1. open the Thunderbird address book
    2. select the address book you like to export
    3. go to Tools->Export
    4. select „Comma Separated“ as format in the bottom right corner
    5. choose addresses.csv as name and save the file in a directory you like e.g. /tmp
  2. configure GPG
    1. open the file ~/.gnupg/gpg.conf with a text editor
    2. add this line to the file:
      of course you can use any other keyserver if you like
    3. save the file 🙂
  3. search for keys and import them
    1. open a console
    2. navigate to the directory you saved the file in e.g: cd /tmp
    3. run this command:
      for add in `cat addresses.csv | cut -d“,“ -f5 | grep @`; do gpg -i –search-keys  $add; done
      This command will go through the file addresses.csv line by line, get the 5th element out of it and search if the server has a key for this email.
    4. If a key was found you will be asked to select it and if you like to import it.
    5. After a restart of Thunderbird you should see the newly imported keys in: OpenPGP > Key Management


Kategorien:English Schlagwörter: , ,
  1. thias
    Juni 5, 2014 um 11:06

    thanks for the script! unfortunately the browser changes the “ and the double — before search-keys. i had to edit it before i got it to work.

    for add in `cat addresses.csv | cut -d“,“ -f5 | grep @`; do gpg -i –search-keys $add; done

  2. HEX
    Januar 13, 2016 um 22:42

    Dank Dir, danach habe ich schon lange gesucht. Eine Integration der automatischen Suche nach evtl. vorhandenen Keys in enigmail wäre eine super Sache, so ähnlich wie es bei posteo im webmailer jetzt versucht wird. Aber vielleicht kommt der Durchbruch dann ja mit der neuen enigmail/pretty-easy-privacy Version.

  1. No trackbacks yet.

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

Du kommentierst mit Deinem Abmelden /  Ändern )

Google Foto

Du kommentierst mit Deinem Google-Konto. Abmelden /  Ändern )


Du kommentierst mit Deinem Twitter-Konto. Abmelden /  Ändern )


Du kommentierst mit Deinem Facebook-Konto. Abmelden /  Ändern )

Verbinde mit %s

%d Bloggern gefällt das: