7

I'd like to convert a PEM(+key) certificate to a *.p12 file. I know this is how I do it when I don't have an intermediate certificate:

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

How do I do it when I have an intermediate certificate?

Ztyx
  • 1,385
  • 3
  • 14
  • 28

1 Answers1

16

You need to concatenate all the PEM files into one, then convert it to PKCS#12:

$ cat certificate.crt intermediate.crt > bundle.crt
$ openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in bundle.crt
garethTheRed
  • 4,539
  • 14
  • 22