I create a keystore and from that keysore I generate a CSR file and when I receive Signed Certificate from CA, I imported root and intermediate certificates to my keystore and finally my signed certificate. After I add signed certificate I got "certificate reply was installed in keystore" response. In this format I can use my keystore in Tomcat, however, for another application container I need only private key containing pem encoded file. And
keytool -importkeystore -srckeystore server.jks -destkeystore server.pkcs -srcstoretype JKS -deststoretype PKCS12 openssl pkcs12 -in server.pkcs -out server.pem
seems not working. I am getting a pem file which only contains certificate info not private key.
So is it possible to export private key after establishing a certificate chain? If it is how?