title: Generate PKCS12 file using Java
body: <p>I need to generate a PKCS12 file using Java.
  Actually, I need to automate the following certificate generation using openssl (the ca was created previously and is not pretended to automate its creation):</p>
  <blockquote>
  <p>openssl genrsa -out client.key 2048</p>
  <p>openssl req -new -key client.key -out client.csr</p>
  <p>openssl ca -keyfile ca.key -cert ca.crt -out client.crt -policy policy_anything -infiles client.csr</p>
  <p>openssl pkcs12 -export -in client.crt -inkey client.key -out client.p12 -name client</p>
  </blockquote>
  <p>I want to know if it's possible to perform this without using Bouncycastle or similar libraries, just only JCE, because I didn't find any info related with the PKCS12 generation.</p>