Yesterday, I need a certificate for JBoss (in fact, for the tomcat include in jboss). Few months ago (probably more than year), I wrote some ugly shell scripts to manage a CA. So, I decide to rewrite this engine, in Perl this time.
You can find more information here
This script is very useful for me, maybe it will for you too.