{"id":3123,"date":"2014-06-09T11:13:40","date_gmt":"2014-06-09T03:13:40","guid":{"rendered":"http:\/\/rmohan.com\/?p=3123"},"modified":"2014-06-09T11:13:40","modified_gmt":"2014-06-09T03:13:40","slug":"convert-from-crt-to-pfx-with-openssl","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=3123","title":{"rendered":"Convert from CRT to PFX with openssl"},"content":{"rendered":"<p>In Windows cases you need to merge these files into a PFX file.<\/p>\n<p>Now before I tell you the secret I wish to explain what the difference is between the different files so you know how the certificate works.<\/p>\n<p>\u2022A .csr file is a certificate signing request which initiates your certificate request with a certificate provider and contains administrative information about your organization.<br \/>\n\u2022A .key file is the private key used to encrypt your site\u2019s SSL-enabled requests.<br \/>\n\u2022.pem and .crt extensions are often used interchangeably and are both base64 ASCII encoded files. The technical difference is that .pem files contain both the certificate and key whereas a .crt file only contains the certificate. In reality this distinction is often ignored.<br \/>\n\u2022The PFX extension is used on Windows servers for files containing both the public key files (your SSL certificate files, provided by for instance DigiCert) and the associated private key (generated by your server at the time the CSR was generated).<\/p>\n<p>So in my case I had a crt file for the certificate itself and I had a crt file for the CA and I had the private key within a .key file.<br \/>\nNow I had to \u201cmerge\u201d these into a PFX file so I could import it for use for Lync.<br \/>\nNow this is where openssl comes in.<\/p>\n<p>Openssl comes often default with most linux distroes (ubuntu,fedora etc) in my case I had the Netscaler VPX available.<br \/>\nBefore you can use openssl on Netscaler you have to type the command shell to enter the regular freebsd shell.<\/p>\n<p>So type the command openssl pkcs12 \u2013export \u2013out certificate.pfx \u2013inkey rsaprivate.key \u2013in certificate.crt \u2013certfile fileca.crt<br \/>\nAfter that you need to type a password to encrypt the pfx file.<\/p>\n<p>openssl pkcs12 -export -out rmohan.pfx -inkey rmohan.key -in rmohan_com.crt -certfile PositiveSSLCA2.crt<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Windows cases you need to merge these files into a PFX file.<\/p>\n<p>Now before I tell you the secret I wish to explain what the difference is between the different files so you know how the certificate works.<\/p>\n<p>\u2022A .csr file is a certificate signing request which initiates your certificate request with a certificate [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3123"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3123"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3123\/revisions"}],"predecessor-version":[{"id":3124,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3123\/revisions\/3124"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}