title: Can BouncyCastle convert a P12 to PEM
body: <p>A CA gives me a P12 which I want to convert to PEM inside a jvm.</p>
  
  <p>Yes using openssl command works:</p>
  
  <pre><code>openssl pkcs12 -in jack.p12 -out jack.pem -nodes -clcerts
  </code></pre>
  
  <p>But then it gets ugly getting key and keystore passwords into the openssl program from java not to mention unsecure.</p>
  
  <p>so BouncyCastle seems to be best crypto API for java...
  How could it be done (convert P12 to PEM) using bouncy...</p>