In this article we will use the OpenSSL library to create a PKCS#12 Keystore from an existing Private Key & Certificate. This demonstration uses MacOS but the same steps can be followed on other operating systems that support OpenSSL.
- Navigate to the directory where the certificate and private key is stored and enter the following commands (replacing anything in < > if file names are different).
- keystore.p12 = the name of the PKCS#12 file
openssl pkcs12 -export -in <certificate.crt> -inkey <private.key> -name 'tomcat' -out keystore.p12
The PKCS#12 file has been generated in the same directory as the private key and certificate.