#!/bin/sh
# Display a graph of gpg public keys and signatures
# You need sig2dot and graphviz packages on Debian/Ubuntu
# http://www.chaosreigns.com/code/sig2dot/
# http://www.graphviz.org/

# You can try different graphviz drawing backend
# dot, neato, twopi, circo, fdp
# add -all option to try all those and pick the best rendering one

# Example: http://vrac.fifi.be/gpg-wot.png

BACKENDS="dot neato twopi circo fdp"
DOT=`gpg --list-sigs | sig2dot`

if [ "$1" = "-all" ]
then
	for BACKEND in $BACKENDS
	do echo "$DOT" | $BACKEND -Tpng > /tmp/gpg-wot-${BACKEND}.png; done
else
	echo "$DOT" | dot -Tpng > /tmp/gpg-wot.png
fi
