This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Security and the fly likes Referring the U.S.Export Policy and localPolicy while creating the Executable Jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "Referring the U.S.Export Policy and localPolicy while creating the Executable Jar" Watch "Referring the U.S.Export Policy and localPolicy while creating the Executable Jar" New topic
Author

Referring the U.S.Export Policy and localPolicy while creating the Executable Jar

Gurumoorthy Doraiswamy
Greenhorn

Joined: Jan 15, 2013
Posts: 21
Hi,

I am a .NET developer and very new to Java. I have created a program which requires 256-bit AES encryption in .NET and Decryption in java. To include the support of 256-bit encryption in Java i downloaded the followed the steps as given in the below url

http://www.ngs.ac.uk/tools/jcepolicyfiles

And to create the executable from jar i used java -cp "jar name". The issue is when i run the program in Netbeans the application works normally. But when i try to run the exe seperately i get the "Illegal key size" error. To refer the external jars i used

java -cp "jar name; jars/*"

where jars is folder name under which i am referring all the necessary jars. The same exe runs normally when i use 128bit encryption. Kindly let me know where i am missing out.

Note: I also tried "jar2exe" wizard trial version but the same error occurs when i use 256-bit encryption and with 128-bit it works normally.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36599
    
  16
Welcome to the Ranch
You would have to explain lots more; I cannot understand how the question relates to the thread title.
I shall move this discussion because it is too difficult for “beginning Java”.
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 971
    
  10

Sounds like you are picking up a 'java' that has not had the unlimited strength files installed. If you are using Windows are you sure you installed it in both the JRE and the JDK? I suspect that Netbeans is using the JDK 'java' and your application when run from the command line is using the JRE 'java' .
Gurumoorthy Doraiswamy
Greenhorn

Joined: Jan 15, 2013
Posts: 21
Many thanks Richard Tookey. yes it is my mistake the JRE and JDK path which referes does not refer the policies. Really you have saved me
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Referring the U.S.Export Policy and localPolicy while creating the Executable Jar
 
Similar Threads
Jar Files and Classpath
jar files
Java executable jar with embedded Derby DB
Jar file exception due to not finding Oracle driver but other standalone programs can use it
Classpath Issues with java -jar option