How to get crt key and private key from .pfx or .pem

How to get crt key and private key from .pfx or .pem

1.  Install Openssl in Ubuntu16/18

sudo apt-get install openssl libssl-dev -y

2. Convert SSL

Upload .pfx SSL to server
 
openssl pkcs12 -in domain.pfx -nodes -out domain.pem
openssl rsa -in domain.pem -out domain.key
openssl x509 -in domain.pem -out domain.crt
openssl pkcs12 -in domain.pfx -nocerts -nodes -out domain.rsa

3. Get crt key

cat domain.crt

4. Get private key

cat domain.key

Add Feedback