Skip to content

Instantly share code, notes, and snippets.

@fduran
Created January 21, 2013 15:35
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save fduran/4586880 to your computer and use it in GitHub Desktop.
Save fduran/4586880 to your computer and use it in GitHub Desktop.
Create Java KeyStore from SSL certificate
# www.fduran.com
# Create Java KeyStore from SSL certificate for domain example.com
# Change format from cert.crt PEM (----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----) to DER
openssl x509 -in cert.crt -inform PEM -out cert.der -outform DER
# create KeyStore cert.jks for your domain ("alias" in keytool, "common name" or CN in openssl req)
keytool -import -trustcacerts -alias example.com -file cert.der -keystore cert.jks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment