Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create a pfx file from a .cer and a .pem file

I have used openssl to create a .key and .cer file in pem format (you can read them). Now I want to create .pfx file from them. I have read openssl doumentation it says something like following command I can use

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

but I don't know which one is my .cer file (certificate.cer or CACert.cer) what is differences between these two files?

like image 608
user217648 Avatar asked Oct 05 '13 15:10

user217648


People also ask

Can you convert PEM to pfx?

PEM certificates are not supported, but you can convert them to PKCS#12 (PFX) format.

Are .CER and .PEM interchangeable?

1 Answer. Show activity on this post. . Windows can use both encodings and it does not matter if the file has .


1 Answers

The certificate.cer is your public key and the CACert.cer file (as it names suggest) is the public key of a CA (maybe the one who has signed your certificate).

The -in switch specifies input certificate to embed in output file

The -inkey switch specifies the key file you've generated using OpenSSL

The -out switch tells the openssl your desired name for output file

The -certfile is used to specify additional certificates to add to the output pfx file (it could be ignored)

like image 124
zaerymoghaddam Avatar answered Sep 28 '22 10:09

zaerymoghaddam