title: How to create Java Key Store (.jks) file with AES encryption
body: <p>Reading Oracle documentation, I see that by default JKS files are encrypted using <code>PBEWithMD5AndTripleDES</code>. While DES alone makes me feel uneasy, MD5 lights a big red light. I'd like to use <code>PBEWithSHA256And256BitAES-CBC-BC</code> or <code>PBEWithSHA256And128bitAES-CBC-BC</code> to encrypt private keys.</p>
  
  <p>Do I have to write new Cryptography Service Provider implementing whole KeyStore interface or is it possible to parametrise the creation of KeyStore (either using plain java or BouncyCastle)?</p>
  
  <p><strong>EDIT:</strong>
  A little bit of background.</p>
  
  <p>I know that 3DES isn't broken, just as is MD5 used as KDF (or in PBE). The problem is, that this is the situation for <em>now</em>. For all we know, MD5 may be broken to the level MD4 is broken tomorrow. My application life is at least 10 years, and it's very likely it's much more. Somehow I don't see people after those 10 years delving deep into <em>working</em> crypto code just because it may not be secure. One just needs to look at last few of the big "mishaps" with password leaks to see how likely is that, and that were obvious things to anyone that saw the raw database.</p>
  
  <p>That being said: NSA crypto suite B allows only AES for symmetric encryption, of any kind. 
  NIST list only SHA-1 and SHA-2 algorithms for HMAC and KDF use, while SHA-1 use is <em>not recommended</em>. Suite B allows <em>only</em> SHA-2 hash functions. Those algorithms are publicly available, so why shouldn't I use them?</p>