How Do I Convert a Non-PEM Certificate into a PEM One?
- Converting a .cer or .crt certificate into a .pem one
Change the name extension of the certificate file.
For example, change certificate.cer to certificate.pem.
- Converting a .pfx certificate into a .pem one Use OpenSSL to convert the certificate.
# Certificate extraction command openssl pkcs12 -in certificate.pfx -nokeys -out cert.pem # Private key extraction command openssl pkcs12 -in certificate.pfx -nocerts -out key.pem -nodes
- Converting a .p7b certificate into a .pem one
Use OpenSSL to convert the certificate.
- Run the following command to convert the certificate:
openssl pkcs7 -print_certs -in incertificat.p7b -out outcertificate.cer
- Obtain the certificate content in outcertificat.cer.
- Save the content in .pem format.
- Run the following command to convert the certificate:
- Converting a .der certificate into a .pem one Use OpenSSL to convert the certificate.
# Certificate extraction command openssl x509 -inform der -in certificate.cer -out certificate.pem # Private key extraction command openssl rsa -inform DER -outform PEM -in privatekey.der -out privatekey.pem
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.