Skip to content

Instantly share code, notes, and snippets.

@jfinstrom
Forked from snay2/sign.sh
Last active September 30, 2018 20:15
Show Gist options
  • Save jfinstrom/93b5c3a4d04a94ef7e6188b6e0db6965 to your computer and use it in GitHub Desktop.
Save jfinstrom/93b5c3a4d04a94ef7e6188b6e0db6965 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 --armor --export $KEY_ID > $KEY_ID.asc
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment