-
-
Save iamdvr/b05885e351befbe5fed3d13969c37cdf to your computer and use it in GitHub Desktop.
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 keystore format): | |
keytool -importkeystore -srckeystore { java-keystore.jks } -destkeystore { pkcs12-keystore.p12 } -deststoretype PKCS12 | |
2. Extract pem (certificate) from ".p12" keystore file: | |
openssl pkcs12 -nokeys -in { pkcs12-keystore.p12 } -out { certificate-chain.pem } | |
3. Extract unencrypted key file from ".p12" keystore file: | |
openssl pkcs12 -nocerts -nodes -in { pkcs12-keystore.p12 } -out { unencrypted-key.key } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment