Converting PFX File to .Pem file using OpenSSL in Windows 10 .
Windows 10 – Version 1607 or Above –
![image image](https://crtech.tips/wp-content/uploads/2023/04/Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
Some Application never allow .pfx file to import directly. Running Ubuntu Bash shell become much simpler in Windows 10
In Windows 10 you can have a linux subsystem . It’s a great feature for sys admins for these sort of tasks.
Start – Run – Appwiz.cpl – Turn Windows Features on or off.
![image image](https://crtech.tips/wp-content/uploads/2023/04/1681664997_939_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
![image image](https://crtech.tips/wp-content/uploads/2023/04/1681664997_199_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
![image image](https://crtech.tips/wp-content/uploads/2023/04/1681664997_320_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
Note : All Commands and Directory Names are Case Sensitive
List the Drives you can mount –
cd /mnt/ |
Press TAB to list the Drives. Mounting F Drive.
cd /mnt/f |
![image image](https://crtech.tips/wp-content/uploads/2023/04/1681664997_641_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
![image image](https://crtech.tips/wp-content/uploads/2023/04/1681664997_715_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
Change Directories get inside c:\cert –
cd /mnt/f/cert/ |
List Directories –
![image image](https://crtech.tips/wp-content/uploads/2023/04/1681664997_169_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
To Export private key from the Pfx File and Make .PEM file –
openssl pkcs12 -in mycert.pfx -nocerts -out key.pem -nodes |
![image image](https://crtech.tips/wp-content/uploads/2023/04/1681664997_272_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
To Export Certificate from the Pfx file to .PEM file –
openssl pkcs12 -in mycert.pfx -nokeys -out cert.pem |
![image image](https://crtech.tips/wp-content/uploads/2023/04/1681664997_536_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
Remove the Passphrase from Key.Pem File (Optional) –
openssl rsa -in key.pem -out server.key |
![image image](https://crtech.tips/wp-content/uploads/2023/04/1681664997_446_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
To Export to .crt
openssl pkcs12 -in mycert.pfx -clcerts -nokeys -out mycert.crt |
![](https://crtech.tips/wp-content/uploads/2023/04/1681664997_183_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)
Remove the Passphrase from Key.Pem File (Optional) –
You can see below files –
![](https://crtech.tips/wp-content/uploads/2023/04/1681664997_438_Converting-PFX-File-to-PEM-file-using-OpenSSL-in-Windows.png)