Search code examples
javacertificate-store

Imported certificate (via keytool) not displaying in Java Control Panel


I imported a root signer CA certificate into Java SE 8 using the following command:

keytool -importcert -alias "DigiCert Global Root G2" -file DigiCert_Global_Root_G2.pem

I got the following message that the certificate was imported successfully: "Certificate was added to keystore". I know that it was added, because I can view information for it using the keytool -list command.

However, when I view the Java Control Panel and go into Manage Certificates, the certificate doesn't appear anywhere. I rebooted my PC after importing the certificate. I looked everywhere in Manage Certificates: in both the User and System tabs for every certificate type.

Does anyone have any idea why the imported certificate isn't showing up in the control panel?


Solution

  • Add this to your command and see if that works:

    -keystore $JAVA_HOME\lib\security\cacerts
    

    Note: in case your JAVA_HOME is set to jdk, the path will be :

    -keystore $JAVA_HOME\jre\lib\security\cacerts
    

    The default password of keystore is "changeit". Also be careful about the white space in your "JAVA_HOME" variable.