6 USAGE
="Usage: $0 [-p papersize] [-r revoked-style] keyid-or-name"
25 PAPERSIZE
=`echo $1 | sed -e 's/^-p//'`
34 REVOKESTYLE
=`echo $1 | sed -e 's/^-r//'`
48 case "$REVOKESTYLE" in
49 grey|hide|note|show|strike
)
52 echo >&2 "Unknown style \"$REVOKESTYLE\". Please use one of"
53 echo >&2 " grey - Print text in grey"
54 echo >&2 " hide - Don't show revoked uids"
55 echo >&2 " note - Add \"(revoked)\""
56 echo >&2 " show - List revoked uids normally"
57 echo >&2 " strike - Strike through lines"
62 TMPFILE
=`mktemp -t gpg-key2ps.XXXXXX`
64 if ! gpg
--fingerprint --with-colons $KEYIDS 2>/dev
/null
>$TMPFILE; then
65 echo >&2 "Key not found. Try 'gpg --list-keys'"
70 NUMLINES
=$
((`wc -l <$TMPFILE` + `grep '^pub:' $TMPFILE | wc -l` - 1))
72 if test -x /usr
/bin
/paperconf
; then
83 %%BoundingBox: 0 0 $w $h
85 %%Creator: gpg-key2ps $VERSION
87 echo "%%CreationDate: `date`"
97 /Times-Roman findfont 9 scalefont setfont
105 w 2 div 30 sub y 3 add lineto stroke
110 /condhline { hline } def
119 50 y moveto (pub) show
120 70 y moveto show show (/) show show
128 70 y moveto (Key fingerprint = ) show show
133 50 y moveto (uid) show
140 case "$REVOKESTYLE" in
149 echo "/revuid {} def"
153 echo " 50 y moveto (uid) show"
154 echo " 200 y moveto show ([revoked]) show"
159 echo "/revuid { uid } def"
164 echo " 45 y 9 add moveto h 2 div 45 sub y 18 add lineto stroke"
172 50 y moveto (sub) show
173 70 y moveto show show (/) show show
183 -e 's/^pub:[^:]*:\([^:]*\):1:.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:.*/ (\4) (\3) (\2) (R) (\1) pub/' \
184 -e 's/^pub:[^:]*:\([^:]*\):17:.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:.*/ (\4) (\3) (\2) (D) (\1) pub/' \
185 -e 's/^fpr:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/ (\1) fpr/' \
186 -e 's/(\(.\{16,16\}\)\(.\{16,16\}\)) fpr/(@split@\1@ @split@\2@) fpr/' \
187 -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' \
188 -e 's/(\(.\{20,20\}\)\(.\{20,20\}\)) fpr/(@split@\1@ @split@\2@) fpr/' \
189 -e 's/@split@\(.\{4,4\}\)\(.\{4,4\}\)\(.\{4,4\}\)\(.\{4,4\}\)\(.\{4,4\}\)@/\1 \2 \3 \4 \5/g' \
190 -e 's/^uid:[^:r]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/ (\1) uid/' \
191 -e 's/^uid:r[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/ (\1) revuid/' \
192 -e 's/^sub:[^:]*:\([^:]*\):16:.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:.*/ (\3) (\2) (g) (\1) sbk/' \
198 echo "/numlines $(($NUMLINES + 1)) def"
200 /num w 16 sub 10 div numlines div def
206 0 0 h 2 div w rectclip
211 0 upper h 2 div upper h 2 div lower 0 lower 0 upper moveto lineto lineto lineto lineto stroke