How to convert a .p7b (PKCS#7) certificate to JKS format

  • KM03813683
  • 11-Jun-2021
  • 11-Jun-2021

Summary

In some circumstances only a .p7b (PKCS#7) certificate can be obtained for SSL

Question

In some circumstances only a .p7b (PKCS#7) certificate can be obtained for SSL with ALM or Octane

Answer

Before you begin

  • Obtain a PKCS#7 package (*.p7b) from the Certification Authority that contains the CA-signed server certificate, intermediate certificates, and the CA root certificate.

  • You need to know the keystore name, password, and alias you used when you created the keystore.

To import certificates contained within a p7b file

  • Add the certificates from the PKCS #7 file (FullChainOfCerts.p7b in this example) to the Java keystore. The alias in this command needs to match the alias you specified when you generated your key pair. For example:

    keytool -importcert -alias rgateway -trustcacerts -file FullChainOfCerts.p7b -keystore newkeystore.jks –storetype JCEKS