Skip to content

Instantly share code, notes, and snippets.

View mariusbalanuca's full-sized avatar

Marius Balanuca mariusbalanuca

View GitHub Profile
@pjosalgado
pjosalgado / jks-to-nginx-command-list
Last active August 8, 2020 14:10 — forked from ilguzin/gist:6606011
How to convert Java Key Store file to pem/key for NGINX.
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 }