You are currently viewing How to Create a PKCS#12 Keystore from a Private Key & Certificate

How to Create a PKCS#12 Keystore from a Private Key & Certificate

  • Post author:
  • Post category:Kelvin / PKI
  • Post comments:0 Comments
  • Post last modified:04/04/2023
  • Reading time:1 mins read

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.

iwiizkiid

Kelvin is a Cyber Security professional with years and experience working with organisations in different verticals, both large and small. He enjoys contributing to the Network Wizkid knowledge base and he also creates technical content. Kelvin enjoys learning new things and often does this by working on achieving new technical certifications. He holds many professional certifications and academically, he has achieved a Bachelors and Master's degree in both Computer Networks and Cyber Security.

Leave a Reply