Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting Illegal key size or default parameters

 
Raghvendra Pratap Singh
Greenhorn
Posts: 22
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am getting java.security.InvalidKeyException: Illegal key size or default parameters , I have fallow all the required step ,Installed Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
Also I have Gone through these Threads

java.security.InvalidKeyException: Illegal key size or default parameters error
Java Security: Illegal key size or default parameters?

But I am still stuck and getting java.security.InvalidKeyException: Illegal key size or default parameters ,

Below is My Code :
AESKeyGenerator.java



My Erro Stack Trace is




I Check with the standard code which is also same as this. I think there is some issue with configuration or missing libirary.

Please Help me

Thanks,
Raghvendra Pratap Singh
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the exception is thrown from within a servlet and we can't see the parameters you are using and how you are using this code it is difficult to help. Your best bet is to create and post a stand alone test harness that illustrates the problem and that does not involve your servlet.

Having looked in more detail at your code it seems to be nonsense and cobbled from code used for a very different purpose. Presumably the String 'dhkey' was originally a Diffe-Hellman parameter but I have no idea how the names of the methods generate_r() and generate_k() relate to their current functionality. You also need to work on your exception handling since it is dreadful.

P.S. Are you sure you have installed the Unlimited Strength files in the JDK being used to run your application server?
 
Raghvendra Pratap Singh
Greenhorn
Posts: 22
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rechard Thanks for the Reply,

But that was nothing nonsense, I just asked that am I doing any configuration error, I was dam sure that there was nothing wrong with the code, that why i placed the code.

anyway
Actually That all was due to wrong installation,

I did wrong first is that I installed the policy files into Program files/jdk_1.7.0_13/jre/lib/security, but the JRE which was used is located in Program files/jre7


Now its working fine .

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic