Where can I upload a list of my friends and get a list of their keys found on keyservers?

Here are some key servers:

If I had nothing to do all day, I could open my address book each week and paste in each of my friends address and import them.

How can I automatically fetch and update my friend's keys based on a list of their e-mail addresses?

  • 2
    don't forget that you need to TRUST the key : it means you need to be SURE it's their key, and not one with the same name (or one trying to appear to be someone else) ! So in other words: your friends send you their keys via a reliable way (or tell you via a reliable way where they stored it and what's its signature is), and you then assign trust to their public keys. iow, you need to ensure the keys you find are really their keys! – Olivier Dulac Sep 24 '13 at 15:19

Just save a very small script. You could even run it using a cron job.

This code will read a file, search for each line on the default keyserver, extract found key IDs and recieve them. Call as search-friends-keys.sh myfriendlist.txt if file names used accordingly.

If using as cron job, watch out to run the script in the correct user context (not as root)!

while read line
    gpg --with-colons --batch --search $line 2>/dev/null | \
    awk 'BEGIN { FS = ":" };  $1=="pub" { print $2 }' | \
    xargs gpg --recv-keys
done < $1
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.