title: How to create a JKS or P12 keystore with Python
body: <p>I'm working on a Python 3 script that among other things, at some point it needs to create a .JKS or .P12 keystore. I use to have a bash script that used keytool for this:</p>
  <pre><code>keytool -genkey -keyalg RSA -alias certAlias \
          -keystore keystore.jks -storepass $keyPass \
          -validity 360 -keysize 2048 \
          -noprompt -dname &quot;CN=com.myCompany, OU=ID, O=AwesomeSoft, L=SF, S=CA, C=US&quot; \
          -keypass $keyPass
  
  mv ./keystore.jks src/main/resources/
  </code></pre>
  <p>Now i'm moving the same functionality from that bash script to python and I having some issues to figure it out and any pointer will ne more than welcome..  you may noticed that the example above is for jks, not p12... the newer version have to be able to, depending on a variable before called certType with create one or the other... or create a jks and later convert it to p12... i'm open to options..</p>
  <p>Thanks in advance!!</p>