#! /bin/sh set -e VERSION="0.3.1" USAGE="Usage: $0 [-p papersize] [-r revoked-style] keyid-or-name" if [ -z "$*" ]; then echo $USAGE exit 1 fi KEYIDS= REVOKESTYLE=hide while [ -n "$1" ]; do case "$1" in -p) PAPERSIZE=$2 export PAPERSIZE shift 2 ;; -p*) PAPERSIZE=`echo $1 | sed -e 's/^-p//'` export PAPERSIZE shift 1 ;; -r) REVOKESTYLE=$2 shift 2 ;; -r*) REVOKESTYLE=`echo $1 | sed -e 's/^-r//'` shift 1 ;; -*) echo $USAGE exit 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 -t 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 <