{"id":4951,"date":"2023-11-29T15:40:56","date_gmt":"2023-11-29T23:40:56","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4951"},"modified":"2023-11-29T15:40:59","modified_gmt":"2023-11-29T23:40:59","slug":"how-to-convert-an-ssl-certificate-to-other-formats","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4951","title":{"rendered":"How to Convert an SSL Certificate to Other Formats"},"content":{"rendered":"\n<p>It is highly recommended that you convert to and from .pfx files on your own machine using OpenSSL so you can keep the private key there. Use the following OpenSSL commands to convert SSL certificate to different formats on your own machine:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OpenSSL Convert PEM<\/h3>\n\n\n\n<p><strong>Convert PEM to DER<\/strong><\/p>\n\n\n\n<p><code>openssl x509 -outform der -in certificate.pem -out certificate.der<\/code><\/p>\n\n\n\n<p><strong>Convert PEM to P7B<\/strong><\/p>\n\n\n\n<p><code>openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer<\/code><\/p>\n\n\n\n<p><strong>Convert PEM to PFX<\/strong><\/p>\n\n\n\n<p><code>openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OpenSSL Convert DER<\/h3>\n\n\n\n<p><strong>Convert DER to PEM<\/strong><\/p>\n\n\n\n<p><code>openssl x509 -inform der -in certificate.cer -out certificate.pem<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OpenSSL Convert P7B<\/h3>\n\n\n\n<p><strong>Convert P7B to PEM<\/strong><\/p>\n\n\n\n<p><code>openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer<\/code><\/p>\n\n\n\n<p><strong>Convert P7B to PFX<\/strong><\/p>\n\n\n\n<p><code>openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer<\/code><\/p>\n\n\n\n<p><code>openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OpenSSL Convert PFX<\/h3>\n\n\n\n<p><strong>Convert PFX to PEM<\/strong><\/p>\n\n\n\n<p>When converting a PFX file to PEM format, OpenSSL will put all the certificates and the private key into a single file. You will need to open the file in a text editor and copy each certificate and private key (including the BEGIN\/END statements) to its own individual text file and save them as certificate.cer, CACert.cer, and privateKey.key respectively.<\/p>\n\n\n\n<p><code>openssl pkcs12 -in certificate.pfx -out certificate.cer -nodes<\/code><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Ref: <a href=\"https:\/\/www.sslshopper.com\/ssl-converter.html\">SSL Converter &#8211; Convert SSL Certificates to different formats (sslshopper.com)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is highly recommended that you convert to and from .pfx files on your own machine using OpenSSL so you can keep the private key there. Use the following OpenSSL commands to convert SSL certificate to different formats on your own machine: OpenSSL Convert PEM Convert PEM to DER openssl x509 -outform der -in certificate.pem <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4951\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[104,262,5,10,14,178],"tags":[1717],"class_list":["post-4951","post","type-post","status-publish","format-standard","hentry","category-apache","category-centos","category-linux","category-microsoft","category-windows-7-8-10","category-wordpress","tag-convert-an-ssl-certificate-to-other-formats"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4951"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4951\/revisions"}],"predecessor-version":[{"id":4952,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4951\/revisions\/4952"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}