Created
November 24, 2019 07:40
-
-
Save satdrasing/4372e60b5118267c2dfd5ed8856834a4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ######## Generate a self-signed SSL certificate | |
| keytool -genkeypair -alias tomcat -keyalg RSA -keysize 2048 -keystore keystore.jks -validity 3650 | |
| keytool -genkeypair -alias tomcat -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore keystore.p12 -validity 3650 #PKCS12 | |
| keytool -list -v -keystore keystore.jks | |
| keytool -list -v -storetype pkcs12 -keystore keystore.p12 #PKCS12 | |
| ######### Use an existing SSL certificate | |
| keytool -import -alias tomcat -file myCertificate.crt -keystore keystore.p12 -storepass password | |
| ######### Distribute the SSL certificate to clients | |
| keytool -export -keystore keystore.jks -alias tomcat -file myCertificate.crt | |
| ######### Import the certificate inside the JRE keystore | |
| keytool -importcert -file myCertificate.crt -alias tomcat -keystore $JDK_HOME/jre/lib/security/cacerts | |
| ##### view public key in using openssl | |
| keytool -list -rfc --keystore keystore.jks | openssl x509 -inform pem -pubkey |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment