Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CedricL46/9e9cd9bfa266f118b699754bba3f1d40 to your computer and use it in GitHub Desktop.
Save CedricL46/9e9cd9bfa266f118b699754bba3f1d40 to your computer and use it in GitHub Desktop.
# Open a command terminal in the bin folded of your java installation (e.g: C:\Program File(x86)\Java\jreXXXX\bin)
# In the commands below :
# - selfsigned is the name of the certificate
# - storPass is the password of the keystore and truststore
# - keyPass is the password of the certificate
# You can change those values for yours
#Generate the keystore.jks
keytool -genkeypair -alias selfsigned -keyalg RSA -keysize 2048 -validity 365 -keypass keyPass -storepass storPass -keystore keystore.jks
#Enter your informations when prompt
#Be aware those information will be visible in your browser
#Export the selfsigned.cer from the keystore.jks
keytool -exportcert -alias selfsigned -file root.cer -keystore keystore.jks -storepass storPass
#Generate the truststore.jks
keytool -importcert -alias selfsigned -file root.cer -keystore truststore.jks -storepass storPass
#The jks files are available in the folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment