title: How do I convert a pem to pfx file?
body: <p><a href="https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;actp=CROSSLINK&amp;id=SO26449" rel="noreferrer">This has me confused</a>:</p>
  
  <pre><code>Convert pfx to PEM:
  openssl pkcs12 -in certificatename.pfx -out certificatename.pem
  </code></pre>
  
  <p>Do this dumps out a <strong>single</strong> plain text file.</p>
  
  <p>Now how do I convert this plain text pem back to pfx?</p>
  
  <p>The only commands I see to convert to pfx require the cer and private keys in separate files:</p>
  
  <pre><code>Convert CER and Private Key to PFX:    
  openssl pkcs12 -export -in certificatename.cer -inkey privateKey.key -out certificatename.pfx -certfile  cacert.cer
  </code></pre>