Converting keystores between JKS and P12

Found these keytool commands that saved me some valuable time working with an already existing .p12 certificate for signing an applet.

It withs in JDK6 and onwards (not in JDK5 and earlier).

JKS → P12

keytool -importkeystore -srckeystore keystore.jks -srcstoretype JKS  -deststoretype PKCS12 -destkeystore keystore.p12

P12 → JKS

keytool -importkeystore -srckeystore keystore.p12 -srcstoretype PKCS12  -deststoretype JKS -destkeystore keystore.jks

Original post by tomas at