Monday, April 9, 2018

Get Private Key and certificate from pfx file


1.       Get Private Key and certificate from pfx file (for this we need to install the SSL certificate):

a.       open cmd and go to the installation directory of openSSL
C:\Users\admin>cd %Installed Path of openSSL%

b.       Run the following commands:
C:\OpenSSL-Win32>set openssl_Home=%Installed Path of openSSL%
C:\OpenSSL-Win32>set openssl_conf=%Installed Path of openSSL%\bin\openssl.cfg
C:\OpenSSL-Win32>set path=%Installed Path of openSSL%

c.       Go to bin directory:
C:\OpenSSL-Win32>cd bin

d.       Run the below command to convert pfx file
C:\OpenSSL-Win32\bin>openssl pkcs12 -in mydomain.pfx -nodes

Here you will get private key and certificate

No comments: