How to convert PFX to separate .key/.crt file2 min read
In this article, we will see the commands used to convert.PFX certificate file to separate certificate and key file.
Check OpenSSL package is installed in your system.
Go to the .pfx folder location.
Now type the below command to extract the private key from pfx file.
The explanation for this command, this command extract the private key from the .pfx file. Now we need to type the import password of the .pfx file. This password is used to protect the keypair which created for .pfx file. After entering import password OpenSSL requests to type another password twice. This new password is to protect the .key file.
Extract the certificate:
Just press enter and your certificate appears.
Now we will see how to have an unencrypted .key file to import some applications/devices. Unencrypted keypair very unsafe, so be careful.
We need to enter the import password which we created newly in step 1. Now we have a certificate(.crt) and the two private keys ( encrypted and unencrypted).