Simple Bash function to visualize PKI chain-of-trust
gist.github.com
gist.github.com
only one thing is that fgrep -E (or egrep -F) might not have the result as intended (and indeed doesn't work on later Debian or Ubuntu versions).
See also http://credentiality2.blogspot.hr/2011/03/daily-wtf.html