Created
March 3, 2018 17:04
-
-
Save djraw/d95416be429049363be9a1d06ae69d16 to your computer and use it in GitHub Desktop.
Export private key from a Java Keytool keystore to pem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use Java keytool to convert from JKS to P12... | |
Export from keytool's proprietary format (called "JKS") to standardized format PKCS #12: | |
keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -deststoretype PKCS12 -srcalias <jkskeyalias> -deststorepass <password> -destkeypass <password> | |
...then use openssl to export from P12 to PEM | |
Export certificate using openssl: | |
openssl pkcs12 -in keystore.p12 -nokeys -out cert.pem | |
Export unencrypted private key: | |
openssl pkcs12 -in keystore.p12 -nodes -nocerts -out key.pem | |
This is just a note for me how to convert with openssl. If you need another solution, please use Google.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how about without using openssl?