{"id":789,"date":"2020-01-13T21:18:04","date_gmt":"2020-01-14T03:18:04","guid":{"rendered":"http:\/\/zewwy.ca\/?p=789"},"modified":"2020-01-13T21:18:04","modified_gmt":"2020-01-14T03:18:04","slug":"using-openssl-to-convert-pkcs12-to-pem","status":"publish","type":"post","link":"https:\/\/zewwy.ca\/index.php\/2020\/01\/13\/using-openssl-to-convert-pkcs12-to-pem\/","title":{"rendered":"Using OpenSSL to convert PKCS12 to PEM"},"content":{"rendered":"<p>Found <a href=\"https:\/\/stackoverflow.com\/questions\/15144046\/converting-pkcs12-certificate-into-pem-using-openssl\">from here<\/a><\/p>\n<pre><code>openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys\r\nopenssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes\r\n<\/code><\/pre>\n<p>After that you have:<\/p>\n<ul>\n<li>certificate in newfile.crt.pem<\/li>\n<li>private key in newfile.key.pem<\/li>\n<\/ul>\n<p>To put the certificate and key in the same file use the following<\/p>\n<pre><code>openssl pkcs12 -in path.p12 -out newfile.pem\r\n<\/code><\/pre>\n<p>If you need to input the PKCS#12 password directly from the command line (e.g. a script), just add <code>-passin pass:${PASSWORD}<\/code>:<\/p>\n<pre><code>openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys -passin 'pass:P@s5w0rD'<\/code><\/pre>\n<p>Thanks KMX<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Found from here openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes After that you have: certificate in newfile.crt.pem private key in newfile.key.pem To put the certificate and key in the same file use the following openssl pkcs12 -in path.p12 -out newfile.pem If you need to input the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zewwy.ca\/index.php\/2020\/01\/13\/using-openssl-to-convert-pkcs12-to-pem\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using OpenSSL to convert PKCS12 to PEM&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","footnotes":""},"categories":[8],"tags":[267,268],"class_list":["post-789","post","type-post","status-publish","format-standard","hentry","category-server-administration","tag-openssl","tag-pkcs-to-pem"],"_links":{"self":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/comments?post=789"}],"version-history":[{"count":1,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/789\/revisions"}],"predecessor-version":[{"id":790,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/789\/revisions\/790"}],"wp:attachment":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/media?parent=789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/categories?post=789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/tags?post=789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}