Archiv

Posts Tagged ‘linux’

Collect PGP keys of all your contacts from keyserver

Juli 19, 2013 2 Kommentare

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:
      keyserver pool.sks-keyservers.net
      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

 

Advertisements
Kategorien:English Schlagwörter: , ,
%d Bloggern gefällt das: