Skip to content

Instantly share code, notes, and snippets.

@nilskoppelmann
Last active August 29, 2015 14:13
Show Gist options
  • Save nilskoppelmann/ac16574e659ddfd94bb2 to your computer and use it in GitHub Desktop.
Save nilskoppelmann/ac16574e659ddfd94bb2 to your computer and use it in GitHub Desktop.
Create gpg-lists to hand out at crypto parties

GPG-Party-Lists

##Usage: gpgkeylabel -k KEYID
To get a listing:
gpgkeylabel -l -k KEYID
and then to convert this to a pdf to finally be able to print it out
you will need [phantomjs] (https://github.com/ariya/phantomjs/) and [makepdf.js] (https://gist.github.com/philfreo/5854629) and should use the following:
gpgkeylabel -l -k KEYID | phantomjs ../makepdf.js > yourListing.pdf

####Todo:

  • version without style-tag
#!/bin/sh
kid=
list=0
#list_ln=
set -- $(getopt k:l "$@")
while [ $# -gt 0 ]
do
case "$1" in
(-k) kid="$2";;
(-l) list=1; list_ln=$2;;
(-*) echo "$0 - unrecognized error $1" 1<&2; exit 1;;
(*) break;;
esac
shift
done
gpg=$(gpg --fingerprint $kid)
gpg_html=$(echo "$gpg" | sed -e 's/</\&lt;/' -e 's/>/\&gt;/')
if [[ $list == 1 ]]
then
i=0
echo "<style>body {font-size: 100%;}</style>"
for i in {1..10} #evtl via variable regeln
do
printf "$gpg_html\n\n"
printf "%s\n\n" "-------------------------------------------------------------"
done
elif [[ $list == 0 ]]
then
printf "$gpg\n"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment