
{"id":58,"date":"2018-03-26T21:33:01","date_gmt":"2018-03-26T21:33:01","guid":{"rendered":"http:\/\/www.tygarbyte.com\/?p=58"},"modified":"2018-03-27T05:15:49","modified_gmt":"2018-03-27T05:15:49","slug":"ssl-cert-convert-pfx-to-key-crt-and-pem-format","status":"publish","type":"post","link":"https:\/\/www.tygarbyte.com\/index.php\/2018\/03\/26\/ssl-cert-convert-pfx-to-key-crt-and-pem-format\/","title":{"rendered":"SSL Cert  Convert .pfx to .key &#038; .crt and .pem format"},"content":{"rendered":"<p>This for my future reference, ie when I have to deal with apache based certs ( vs IIS )<\/p>\n<p>Download and install windows port of OpenSSL\u00a0<span style=\"margin: 0px; color: #717171; line-height: 107%; font-family: 'Oxygen',serif; font-size: 10pt;\"><a title=\"OpenSSL Download\" href=\"http:\/\/www.slproweb.com\/products\/Win32OpenSSL.html\" target=\"_blank\" rel=\"noopener\">here<\/a><\/span><\/p>\n<p>** you will need to know your password if you password protect your cert **<\/p>\n<p>Command to enter. 1st part ( extract the .key )<\/p>\n<p><code><span style=\"font-family: Courier New;\">openssl<br \/>\npkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]<\/span><\/code><\/p>\n<p>eg<\/p>\n<p><span style=\"margin: 0px; color: #717171; font-family: 'Oxygen',serif; font-size: 10pt;\">openssl pkcs12 -in d:\\temp\\star.name_of_cert_godaddy.pfx -nocerts -out d:\\temp\\star.name_of_cert_godaddy.key<\/span><\/p>\n<p>** eg I have installed the openssl app in C, I have placed my temp cert in D:\\temp<\/p>\n<p>&nbsp;<\/p>\n<p>2nd part ( extract the .crt )<\/p>\n<p><code><span style=\"font-family: Courier New;\">openssl<br \/>\npkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]<\/span><\/code><\/p>\n<p><code><span style=\"font-family: Courier New;\">eg<\/span><\/code><\/p>\n<p><span style=\"margin: 0px; color: #717171; font-family: 'Oxygen',serif; font-size: 10pt;\">openssl pkcs12 -in d:\\temp\\star.name_of_cert_godaddy.pfx -clcerts -nokeys -out d:\\temp\\star.name_of_cert_godaddy.crt<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Sometimes you need unencrypted key files<\/p>\n<p><code><span style=\"font-family: Courier New;\">openssl<br \/>\nrsa -in [keyfile-encrypted.key] -out [keyfile-decrypted.key]<\/span><\/code><\/p>\n<p><code><span style=\"font-family: Courier New;\">eg<\/span><\/code><\/p>\n<p><span style=\"margin: 0px; color: #717171; font-family: 'Oxygen',serif; font-size: 10pt;\">openssl rsa -in d:\\temp\\star.name_of_cert_godaddy.key -out d:\\temp\\star.name_of_cert_godaddy.nopass.key<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>If you need it in PEM format<\/p>\n<p><code><span style=\"font-family: Courier New;\">openssl<br \/>\nrsa -in [keyfile-encrypted.key] -outform PEM -out [keyfile-encrypted-pem.key]<\/span><\/code><\/p>\n<p><span style=\"color: #000000; font-family: Calibri;\">openssl rsa -in d:\\temp\\star.name_of_cert_godaddy.nopass.key -outform PEM -out d:\\temp\\star.name_of_cert_godaddy.nopass.pem.key<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>note self &#8211; no more searching internet, see your own notes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This for my future reference, ie when I have to deal with apache based certs ( vs IIS ) Download and install windows port of OpenSSL\u00a0here ** you will need to know your password if you password protect your cert ** Command to enter. 1st part ( extract the .key ) openssl pkcs12 -in [yourfile.pfx] [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.tygarbyte.com\/index.php\/wp-json\/wp\/v2\/posts\/58"}],"collection":[{"href":"https:\/\/www.tygarbyte.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tygarbyte.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tygarbyte.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tygarbyte.com\/index.php\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":1,"href":"https:\/\/www.tygarbyte.com\/index.php\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":59,"href":"https:\/\/www.tygarbyte.com\/index.php\/wp-json\/wp\/v2\/posts\/58\/revisions\/59"}],"wp:attachment":[{"href":"https:\/\/www.tygarbyte.com\/index.php\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tygarbyte.com\/index.php\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tygarbyte.com\/index.php\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}