title: How to export .key and .crt from keystore
body: <p>When I was building android app on development machine, I was required to have SSL certificate for app so I generated a keystore with keytool for Tomcat. I extracted the cert from keystore and put it into .bks for using android, and all went well.</p>
  
  <p>Now we have to shift all server-side code to server which required Apache HTTP and Tomcat. Apache HTTP SSL requires .key and .crt files and I cannot find a way to export .key and .crt file from the keystore </p>
  
  <p>Can anyone help with this? I found that you can generate .crt from .pem</p>
  
  <pre><code>openssl x509 -outform der -in your-cert.pem -out your-cert.crt
  </code></pre>
  
  <p>But how can i get .key file?</p>