Skip to content

Instantly share code, notes, and snippets.

@ouyi
Created April 11, 2018 16:20
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 ouyi/da0e7dcc320ec2a819286cbd3aa40b0e to your computer and use it in GitHub Desktop.
Save ouyi/da0e7dcc320ec2a819286cbd3aa40b0e to your computer and use it in GitHub Desktop.
Commands for working with Java keystore
$ sudo keytool -storepass changeit -import -file /tmp/root.crt -noprompt -alias my-trusted-ca -keystore /Library/Java//JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/security/cacerts
Password:
Certificate was added to keystore
// changeit is the Java default keystore password
$ keytool -storepass changeit -list -keystore /Library/Java//JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/security/cacerts | grep my-trusted-ca
my-trusted-ca, Apr 11, 2018, trustedCertEntry,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment