title: Convert Certificate in DER or PEM to pkcs12
body: <p>I have a certificate in DER format it is complete has public key, private key and intermediate certificates location. I need to use it to sign a Java document. I can not use JKS for a third-party library account, I need the certificate to be in pkcs12 format. I got lots of information here and on other sites, but so far I have not found a solution. the most common commands are convert to pem</p>
  
  <p><code>openssl x509 -inform der -in certificate.der -out certificate.pem</code></p>
  
  <p>and many speak of</p>
  
  <p><code>openssl pkcs12 -export -out certificate.p12 -inkey *** -in *** -inform der -certfile ***</code>
  to convert, but this command needs files that I could not get.</p>
  
  <p>In short I have a file that contains all necessary information to convert to pkcs12. It works its import in access to OSX keys and export to pkcs12, however I wish to perform command line (openssl).</p>
  
  <p>Any light?</p>