title: How to programmatically import a pkcs12 file to a Java keystore
body: <p>I have pkcs12 file (keypair.p12 ). With keytool I can import (merge) this with a Java keystore:</p>
  <pre><code>keytool -importkeystore \
          -deststorepass [changeit] -destkeypass [changeit] -destkeystore server.keystore \
          -srckeystore server.p12 -srcstoretype PKCS12 -srcstorepass some-password \
          -alias [some-alias]
  </code></pre>
  <p>How to do the same programmatically?</p>