Wrox Programmer Forums
|
BOOK: Beginning Cryptography with Java
This is the forum to discuss the Wrox book Beginning Cryptography with Java by David Hook; ISBN: 9780764596339
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Cryptography with Java section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 8th, 2007, 01:10 PM
Registered User
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Illegal key size

I downloaded the examples and tried to run the KeyGeneratorExample.java on Chapter 2.

I keep getting Exception in thread "main" java.security.InvalidKeyException: Illegal key size

I had to include this line:
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider ());

So the system would recognize the vendor.
I use JBuilder 2006, but I doubt that's the problem.

Am I the only one having this problem?


 
Old January 8th, 2007, 05:46 PM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

Have you installed the unrestricted policy files for the JCE?

Regards,

David

 
Old January 8th, 2007, 07:24 PM
Registered User
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes I did.
I placed them in my jre directory and made sure that Java_home environment variable is pointing there.

Thanks for such a quick response. Your book is the first one I read on security and I like it very much. It's very thorough. I'm sure it's one of those configurations problems, but I can't find what it can be.

 
Old January 8th, 2007, 09:06 PM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

Thanks for the feedback. Be sure to tell your friends! ;)

By JRE directory, you mean you unpacked the zip file and put the two jar files in jre/lib/security?

Sometime it turns out that IDEs are not using the JRE we think... a good way to check this is to try running the example from the command line. Also in the chapter1 package you'll find a SimplePolicyTest class which will try a couple of things that check the policy files are in place.

What happens when you run chapter1.SimplePolicyTest? Do you find you get different behaviour using the command line versus JBuilder?

Regards,

David






Similar Threads
Thread Thread Starter Forum Replies Last Post
Illegal Assignment Broodmdh Classic ASP Basics 2 August 22nd, 2008 06:21 AM
ERROR: Illegal characters in path owen_xgy .NET Framework 2.0 8 April 2nd, 2008 10:21 AM
Illegal assignment: 'adCmdText' jackiew ASP.NET 1.0 and 1.1 Basics 1 August 23rd, 2007 09:29 AM
ORA-01036: illegal variable name/number vemula_sridhar Oracle 6 December 27th, 2005 06:31 AM
ParseException:Illegal character inAxis Webservice manaspanda J2EE 1 February 23rd, 2004 11:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.