Created
February 18, 2019 19:11
-
-
Save rnestertsov/05ee38e1de22882ce9a124dae74bc736 to your computer and use it in GitHub Desktop.
Managing certificates in the Java keystore
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
| #!/bin/sh | |
| # Add certifiacte | |
| sudo keytool -importcert -alias local-CA \ | |
| -keystore "$JAVA_HOME/jre/lib/security/cacerts" \ | |
| -file my_cert.crt | |
| # get certificate | |
| sudo keytool -list -keystore "$JAVA_HOME/jre/lib/security/cacerts" -alias local-CA | |
| # Delete certificate | |
| sudo keytool -delete -alias local-CA -keystore "$JAVA_HOME/jre/lib/security/cacerts" | |
| # View certificate | |
| openssl x509 -in my_cert.crt -noout -text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment