Language
 
HomeKnowledge Base[HOW-TO] Convert SSL certificate from .cer to .pfx
Information
Article ID142
Created On10/31/2018
Modified3/20/2019
Share With Others
[HOW-TO] Convert SSL certificate from .cer to .pfx

1.) copy the .cer, privatekey.txt to 'C:\cygwin64\home\newfolder'. Then open cygwin go to files path 'cd /home/newfolder' and type the command as below.

                openssl pkcs7 -print_certs -in raw_cert.cer -out converted_file.txt

2.) go back to cywin directory and edit converted_file.txt

3.) edit converted_file.txt and copy the first paragraph  to new text file and save it as mainkey.text       

             -----BEGIN CERTIFICATE-----

 -----END CERTIFICATE-----

6.) Go back to 3rd step file and copy 2nd and 3rd paragraph exactly as 3rd step and save it to new text file as                               cert_authority.text

-----BEGIN CERTIFICATE-----

 -----END CERTIFICATE-----

-----BEGIN CERTIFICATE-----

 -----END CERTIFICATE-----

7.) Go back to cywin and execute this command.

openssl pkcs12 -export -out usable_cert.pfx -inkey privatekey.txt -in converted_file.txt -certfile cert_authority.text

9.) key in the new password and keep it safe since you have to use the password when import the certificate.

10.) Go back to cygwin directory and you will find usable_cert.pfx which is new SSL certificate.


__REQUIREMENTS_________________

* cygwin application
*raw certificate
*privatekey.txt which comes with raw cert
_________________________________