Walt Mankowski on Sun, 3 Nov 2002 21:50:08 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] LISA Keysigning Wed., Nov 6, 8-9 PM


On Thu, Oct 31, 2002 at 10:52:09AM -0500, Walt Mankowski wrote:
> We usually have each bring their own, and everyone should bring enough
> so that everyone supposed to sign his/her signature can get one.
> I usually take 20-30 with me.

Just a reminder that anyone who's going to the LISA/Debian keysigning
Wednesday night needs to bring copies of their GPG fingerprints with
them.  For anyone using Debian, there's a module called
"signing-party" ("apt-get install signing-party") which includes a
useful little program called "gpg-key2ps".  gpg-key2ps creates a
postscript file with as many copies of your GPG fingerprint as will
fit on a page.  You can then cut them up and distribute them at the
keysigning party.

Since the current version in debian testing has a minor bug in that it
includes revoked uid's, and since it's just a short shell script, I've
attached the latest and greatest version of gpg-key2ps.  It was just
emailed to me by the package maintainer a few days ago.

Enjoy.

Walt

#! /bin/sh

if [ -z "$*" ]; then
	echo "Usage: $0 [-p papersize] [-r revoked-style] keyid-or-name"
	exit 1
fi

KEYIDS=
REVOKESTYLE=hide

while [ -n "$1" ]; do
	case "$1" in
	-p)
		PAPERCONF=$2
		export PAPERCONF
		shift 2
		;;
	-p*)
		PAPERCONF=`echo $1 | sed -e 's/^-p//'`
		export PAPERCONF
		shift 1
		;;
	-r)
		REVOKESTYLE=$2
		shift 2
		;;
	-r*)
		REVOKESTYLE=`echo $1 | sed -e 's/^-r//'`
		shift 1
		;;
	*)
		KEYIDS=$1
		shift 1
		;;
	esac
done

case "$REVOKESTYLE" in
grey|hide|note|show|strike)
	;;
*)
	echo >&2 "Unknown style \"$REVOKESTYLE\". Please use one of"
	echo >&2 "  grey   - Print text in grey"
	echo >&2 "  hide   - Don't show revoked uids"
	echo >&2 "  note   - Add \"(revoked)\""
	echo >&2 "  show   - List revoked uids normally"
	echo >&2 "  strike - Strike through lines"
	exit 1
	;;
esac

TMPFILE=`mktemp /tmp/gpg-key2ps.XXXXXX`

if ! gpg --fingerprint --with-colons $KEYIDS 2>/dev/null >$TMPFILE; then
	echo >&2 "Key not found. Try \'gpg --list-keys\'"
	rm $TMPFILE
	exit 1
fi

NUMLINES=$((`wc -l <$TMPFILE` + `grep '^pub:' $TMPFILE | wc -l` - 1))

if test -x /usr/bin/paperconf; then
	w=`paperconf -w`
	h=`paperconf -h`
else
	# Default to A4.
	w=596
	h=842
fi

cat <<EOF
%!PS-Adobe-3.0
%%BoundingBox: 0 0 $w $h
%%Title: 
%%Creator: gpg-key2ps 0.1
EOF
echo "%%CreationDate: `date`"
cat <<EOF
%%Pages: 1
%%EndComments

%%Page: 1 1

/w $w def
/h $h def

/Times-Roman findfont 9 scalefont setfont 

/newline {
	/y y 10 sub def
} def

/hline {
	30 y 3 add moveto
	w 2 div 30 sub y 3 add lineto stroke
	newline
} def

/needhline {
	/condhline { hline } def
} def

/noneedhline {
	/condhline { } def
} def

/pub {
	condhline
	50 y moveto (pub) show
	70 y moveto show show (/) show show
	150 y moveto show
	200 y moveto show
	newline
	needhline
} def

/fpr {
	70 y moveto (Key fingerprint = ) show show
	newline
} def

/uid {
	50 y moveto (uid) show
	200 y moveto show
	newline
} def

EOF

case "$REVOKESTYLE" in
grey)
	echo "/revuid {"
	echo "	.5 setgray"
	echo "	uid"
	echo "	0 setgray"
	echo "} def"
	;;
hide)
	echo "/revuid {} def"
	;;
note)
	echo "/revuid {"
	echo "	50 y moveto (uid) show"
	echo "	200 y moveto show ([revoked]) show"
	echo "	newline"
	echo "} def"
	;;
show)	
	echo "/revuid { uid } def"
	;;
strike)
	echo "/revuid {"
	echo "	uid"
	echo "	45 y 9 add moveto h 2 div 45 sub y 18 add lineto stroke"
	echo "} def"
	;;
esac

cat <<EOF

/sbk {
	50 y moveto (sub) show
	70 y moveto show show (/) show show
	150 y moveto show
	newline
} def

/key {
	noneedhline
EOF
sed -e 's/^pub:[^:]*:\([^:]*\):1:.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:.*/	(\4) (\3) (\2) (R) (\1) pub/' \
    -e 's/^pub:[^:]*:\([^:]*\):17:.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:.*/	(\4) (\3) (\2) (D) (\1) pub/' \
    -e 's/^fpr:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/	(\1) fpr/' \
    -e 's/(\(.\{16,16\}\)\(.\{16,16\}\)) fpr/(@split@\1@  @split@\2@) fpr/' \
    -e 's/@split@\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)@/\1 \2 \3 \4 \5 \6 \7 \8/g' \
    -e 's/(\(.\{20,20\}\)\(.\{20,20\}\)) fpr/(@split@\1@  @split@\2@) fpr/' \
    -e 's/@split@\(.\{4,4\}\)\(.\{4,4\}\)\(.\{4,4\}\)\(.\{4,4\}\)\(.\{4,4\}\)@/\1 \2 \3 \4 \5/g' \
    -e 's/^uid:[^:r]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/	(\1) uid/' \
    -e 's/^uid:r[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/	(\1) revuid/' \
    -e 's/^sub:[^:]*:\([^:]*\):16:.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:.*/	(\3) (\2) (g) (\1) sbk/' \
    <$TMPFILE
cat <<EOF
} def

EOF
echo "/numlines $(($NUMLINES + 1)) def"
cat <<EOF
/num w 16 sub 10 div numlines div def

/column {
	/y w 20 sub def
	1 1 num {
		/upper y 11 add def
		key
		newline
		/lower y 11 add def
		0 upper h 2 div upper h 2 div lower 0 lower 0 upper moveto lineto lineto lineto lineto stroke
	} for
} def

w 0 translate
90 rotate
column
h 2 div 0 translate
column

showpage

%%Trailer
%%EOF
EOF

rm $TMPFILE

Attachment: pgpWPpjNKvqYT.pgp
Description: PGP signature