I just created a self-signed certificate on a linux box running tomcat 6.
I created the keys like this, valid for 10 years:
keytool -genkey -alias to
Use Keystore Explorer gui - http://keystore-explorer.sourceforge.net/ - allows you to extract the private key from a .jks in various formats.