2.7.5 Import the Certificate to JDK Security

This section describes how to import the certificate to JDK security and it is required for both signed and self-signed certificates.

To import .p12 and .jks files:
  1. Execute the following command to convert .p12 file to .cer format.
    keytool -exportcert -keystore <Path of .p12 file >/<filename>.p12 - storetype PKCS12 -alias <alias> -file <Path where studiop.cer file should be created>/studiop.cer
    For example:
    keytool -exportcert -keystore /<COMPLIANCE_STUDIO_INSTALLATION_PATH>/ studio_server.p12 -storetype PKCS12 -alias studio_server -file /<COMPLIANCE_ STUDIO_INSTALLATION_PATH>/studiop.cer
  2. Execute the following command to import .cer to jdk security.
    keytool -importcert -keystore <JAVA_HOME>/lib/security/cacerts - storepass changeit -alias studio_server -file <Path of studiop.cer file created from about command>/studiop.cer
    For example:
    keytool -importcert -keystore /Home/fccstudio/jdk-11.0.18/lib/security/ cacerts -storepass changeit -alias studio_server -file /<COMPLIANCE_STUDIO_ INSTALLATION_PATH>/studiop.cer

    Note:

    If you need to delete certificate from the JDK then execute the following command:

    keytool -delete -noprompt -alias studio_server -keystore "<JAVA_HOME>/lib/security/cacerts" -storepass "changeit"

    This can be helpful if you need to re-import a new certificate in the JDK.