Search code examples
javajvmkeytool

How do I find out what keystore my JVM is using?


I need to import a certificate into my JVM keystore. I am using the following:

keytool -import -alias daldap -file somecert.cer

so I would need to probably change my call into something like:

keytool -import -alias daldap -file somecert.cer -keystore cacerts –storepass changeit

Solution

  • Your keystore will be in your JAVA_HOME---> lib---> security--> cacerts. You need to check where your JAVA_HOME is configured, possibly one of these places,

    1. Computer--->Advanced --> Environment variables---> JAVA_HOME

    2. Your server startup batch files.

    In your import command -keystore cacerts (give full path to the above JRE here instead of just saying cacerts).