Extracting the Private Key from a Java Keystore
Jump to navigation
Jump to search
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.