Note that there are some explanatory texts on larger screens.

plurals
  1. POGenerating digital certificate:InvalidKeyException: Illegal key size
    primarykey
    data
    text
    <p>Writing code to generate digital certificate </p> <p>Here is the piece of code causing problem </p> <pre><code> PBEKeySpec keySpec = new PBEKeySpec(password); SecretKeyFactory keyFactory = SecretKeyFactory .getInstance("PBEWITHMD5ANDTRIPLEDES"/* "PBEWithSHAAndTwofish-CBC" */); SecretKey key = keyFactory.generateSecret(keySpec); PBEParameterSpec paramSpec = new PBEParameterSpec(salt, MD5_ITERATIONS); Cipher cipher = Cipher.getInstance("PBEWITHMD5ANDTRIPLEDES"); cipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);//here Ex. byte[] ciphertext = cipher.doFinal(plaintext); </code></pre> <p>Facing the exception </p> <pre><code>java.security.InvalidKeyException: Illegal key size at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1023) at javax.crypto.Cipher.implInit(Cipher.java:789) at javax.crypto.Cipher.chooseProvider(Cipher.java:848) at javax.crypto.Cipher.init(Cipher.java:1347) at javax.crypto.Cipher.init(Cipher.java:1281) at chapter4.GenSig.passwordEncrypt(GenSig.java:290) at chapter4.GenSig.generateKeyPair(GenSig.java:92) at chapter4.GenSig.main(GenSig.java:48) </code></pre> <p>As I tried to search on internet with the exception name ,Almost all solution said one solution <strong>(install JCE)</strong> add the below jars in security folder of <code>jre</code> and jdk i'm using</p> <pre><code>local_policy.jar US_export_policy </code></pre> <p>Added those jar's and restarted my machine,Still the same issue and posting.</p> <p>Let me know If you need further details.</p> <p><a href="http://pastebin.com/v3FZpV4g" rel="nofollow"><strong>FULL CODE HERE</strong></a></p> <p>Thanks for your time.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload