Skip to content

Instantly share code, notes, and snippets.

@snay2
Created October 21, 2011 17:15
Show Gist options
  • Save snay2/1304368 to your computer and use it in GitHub Desktop.
Save snay2/1304368 to your computer and use it in GitHub Desktop.
Bash shell script to automate PGP key signing
while [ 1 ]; do
echo ">> Enter an email address:"
read EMAIL
gpg --keyserver pgp.mit.edu --search-keys $EMAIL
FINGERPRINT=`gpg --fingerprint $EMAIL`
[[ $FINGERPRINT =~ 2048[DR]/([0-9A-F]{8}) ]];
KEY_ID=${BASH_REMATCH[1]}
gpg --sign-key $EMAIL
echo ">> Going to sign key $KEY_ID"
gpg --keyserver pgp.mit.edu --send-key $KEY_ID
done
@robotfactory
Copy link

Am I reading line 6 right that it will only proceed with 2048 bit keys?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment