Last active
March 9, 2018 07:46
How to convert Java Key Store file to pem/key for nginx
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
1. Convert our ".jks" file to ".p12" (PKCS12 key store format): | |
keytool -importkeystore -srckeystore oldkeystore.jks -destkeystore newkeystore.p12 -deststoretype PKCS12 | |
1.1. List new keystore file contents: | |
keytool -deststoretype PKCS12 -keystore newkeystore.p12 -list | |
2. Extract pem (certificate) from ".p12" keysotre file: | |
openssl pkcs12 -nokeys -in newkeystore.p12 -out certfile.pem | |
3. Extract unencrypted key file from ".p12" keysotre file: | |
openssl pkcs12 -nocerts -nodes -in newkeystore.p12 -out keyfile.key |
awsome! ty
-srcalias is required in step 1 if you want to export a specific alias.
Marvelous!! That worked well.
great , thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool and thanks!