gpg-update-key

If you are using GnuPG, you may receive new signatures or do other changes to your GPG key and want to upload it to keyservers and/or your webserver to make it easier for other people to find it.

Since this is a tedious task, I wrote a little script “gpg-update-key” which does the job for me:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#!/bin/sh

KEY="CC03633F700990F2"
REMOTE_DIR="myserver.org:/var/www"

# upload the key to some key servers
gpg --keyserver subkeys.pgp.net --send-key ${KEY}
gpg --keyserver pool.sks-keyservers.net --send-key ${KEY}
gpg --keyserver pgp.uni-mainz.de --send-key ${KEY}
gpg --keyserver pgp.surfnet.nl --send-key ${KEY}

# export the key
gpg --armor --export ${KEY} > /tmp/pub.asc
gpg --export ${KEY} > /tmp/pub.key

scp /tmp/pub.asc /tmp/pub.key ${REMOTE_DIR}

Note that you should change the KEY and REMOTE_DIR variables otherwise the script won’t help you that much :). Also, the list of key servers to upload are just my personal favourites. Adjust them to your needs.