0

I have got an error:

InvalidKeyException Illegal Key Size 

Then I download 2 files(local_policy, US_export_policy) and put it in

C:\Program Files\Java\jre1.8.0_65\lib\security

everithing worked fine. But when i export project to

Runnable jar file

and then open this jar i have error in my app :

InvalidKeyException Illegal Key Size 

Why it happen? I dont know how to fix this?

SkyWalker
  • 28,384
  • 14
  • 74
  • 132
b1065579
  • 155
  • 1
  • 1
  • 9

1 Answers1

1

You can solve it by two ways:

First way:

You have already put 2 files(local_policy, US_export_policy) in

C:\Program Files\Java\jre1.8.0_65\lib\security

You also need to put it in

C:\Program Files\Java\lib\security

Second way:

You need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files which is available at Oracle.

If you don't then the keysize is limited due to US export laws.

Resource Link:

InvalidKeyException Illegal key size

Community
  • 1
  • 1
SkyWalker
  • 28,384
  • 14
  • 74
  • 132