Convert P12 to JKS

Salesforce Article on how to convert p12 to JKS

Salesforce only accepts JKS(Java Key Store) certificates with an alias. The p12 file password should be between 6 to 8 characters.

Please open the OpenSSL window. Ensure the JAVA_HOME is pointed to JRE main folder and Path is setup to JDK/bin folder.

  1. Create a private key from the p12 file.

openssl pkcs12 -in CLOUDTU.p12 -nocerts -out private.key
//Please enter the certificate password
  1. Create a public key

openssl pkcs12 -in CLOUDTU.p12 -clcerts -nokeys -out certificate.crt
//Please enter the certificate password
  1. Decrypt the private key

openssl rsa -in private.key -out decryptedprivate.key
//Please enter the certificate password
  1. Combine the certificate using the decrypted private key.

openssl pkcs12 -export -in certificate.crt -inkey decryptedprivate.key -out combined.p12 -name "alias"
  1. Convert p12 to JKS using the key tool

keytool -importkeystore -srckeystore combined.p12 -srcstoretype pkcs12 -destkeystore final.jks -deststoretype JKS

 It’s better to use the JDK 8 latest version instead of Java 11.

image-20220210-042921.png

https://help.salesforce.com/s/articleView?id=000381987&type=1


 

Related content