Skip to content

Instantly share code, notes, and snippets.

@rnestertsov
Created February 18, 2019 19:11
Show Gist options
  • Select an option

  • Save rnestertsov/05ee38e1de22882ce9a124dae74bc736 to your computer and use it in GitHub Desktop.

Select an option

Save rnestertsov/05ee38e1de22882ce9a124dae74bc736 to your computer and use it in GitHub Desktop.
Managing certificates in the Java keystore
#!/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