Extracting the Private Key from a Java Keystore
From Peter Pap's Technowiki
Revision as of 01:04, 13 July 2015 by Ppapa (talk | contribs) (Created page with "So you want to move away from using Tomcat and want to extract the server private key. Here's what you need to do: keytool -importkeystore -srckeystore server.jks -destkeysto...")
So you want to move away from using Tomcat and want to extract the server private key. Here's what you need to do:
keytool -importkeystore -srckeystore server.jks -destkeystore server.pkcs -srcstoretype JKS -deststoretype PKCS12
openssl pkcs12 -in thekeystore.p12 -nocerts -nodes -out serverkey.pem
serverkey.pem no contains your server private key.