3.4.2 Convert .crt and .key file to PKC12 file

This topic provides the systematic instruction to convert .crt and .key file to PKC12 file.

  1. Once CA signed certificate is generated, you will be notified on email to download it from the portal, once zip is downloaded from portal it will contain .crt & .key file for requested server.
  2. Convert this .crt and .key file to PKC12 file using openssl command (openssl.exe file could be found under Git installation directory. In my case, “C:\Program Files\Git\usr\bin\openssl.exe”)
    Sample command:
    openssl pkcs12 -export -in <crt_file> -inkey <key_file> -out <p12_file>
     -name <alias_name>
    Sample command with values:
    openssl pkcs12 -export -in whf00pfl.in.example.com.crt -inkey
     whf00pfl.in.example.com.key -out whf00pfl.in.example.com.p12 -name whf00pfl.in.example.com
  3. Import PKCS12 file into Java Keystore using the keytool (keytool can be found under $JAVA_HOME/bin)
    Sample Command:
    keytool -importkeystore -deststorepass <password> -destkeystore
     <jks_file> -srckeystore <p12_file> -srcstoretype PKCS12
     
    Sample command with values:
    keytool -importkeystore -deststorepass Oracle@123 -destkeystore
     whf00pfl_keystore.jks -srckeystore whf00pfl.in.example.com.p12 -
     srcstoretype PKCS12