title: Creating a .p12 file
body: <p>Using <code>openssl</code>, I've created a private key as follows:</p>
  
  <pre><code>openssl genrsa -out myKey.pem
  </code></pre>
  
  <p>Then, to generate the <code>csr</code> demanded by the CA, I've executed the following:</p>
  
  <pre><code>openssl req -new -key myKey.pem -out cert.csr
  </code></pre>
  
  <p>The CA responded with a certificate which I stored in a file named <code>myCert.cer</code></p>
  
  <p>I'd now like to bundle the necessary components (private key, public key(?) and certificate) into a single <code>.p12</code>. To do so I've run the following:</p>
  
  <pre><code>openssl pkcs12 -export -out keyStore.p12 -inkey myKey.pem -in myCert.cer
  </code></pre>
  
  <p>but I'm getting the following error message:</p>
  
  <pre><code>No certificate matches private key
  </code></pre>
  
  <p>How can I accomplish this?</p>