How to create .pfx file from certificate and private key?

You will need to use openssl.

openssl pkcs12 -export -out -inkey -in

The key file is just a text file with your private key in it.

If you have a root CA and intermediate certs, then include them as well using multiple -in params

openssl pkcs12 -export -out -inkey -in -in intermediate.crt -in rootca.crt

If you have a bundled crt file that you use, for example, with nginx, you can pass that in along with the cert all in one:

cat | tee -a
cat intermediate.crt | tee -a
cat rootca.crt | tee -a
openssl pkcs12 -export -out \
  -inkey \

You can install openssl from here: openssl

Leave a Comment