Issue:
Need to convert CER certificates to PEM format and back.
Solution of CER to PEM:
# openssl x509 -outform der -in mycertificate.cer -out mycertificate.der
# openssl x509 -inform der -in mycertificate.der -out myfinalcertificate.pem
Solution of PKS#12 ( .pfx .p12) to PEM w/private key
# openssl pkcs12 -in mykeyring.pfx -out myfinalcertificate.pem -nodes
Separate a PFX certificate w/a password protected private key into its parts:
a. Export the private key:
# openssl pkcs12 -in sourcecertificate.pfx -nocerts -out domainapp_privatekey.pem -nodes
<enter password>
b. Export the certificate:
# openssl pkcs12 -in sourcecertificate.pfx -nokeys -out domainapp_cert.pem
c. Remove the passpphrase from the private key:
Note: This will remove the password protection and create an unencrypted key file.
# openssl rsa -in domainapp_privatekey.pem -out domainapp_privatekey.key
---
If running Windows, MS doesn't include an OpenSSL component. There is a community one:
PS c:\ curl.exe -L -o Win64OpenSSL.exe https://slproweb.com/download/Win64OpenSSL_Light-<version>.exe
previous page
|