Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.security.InvalidKeyException: Wrong key size

843810Mar 14 2002 — edited Dec 27 2002
Hi,
I am getting this InvalidKeyException can someone help me what is that I am missing here.
Thanks
here is the code I am working on
platform- Win2000, JCE1.2.1

String message = "SSO test message";
String ssoKey =new String( "newtestKey");
Security.addProvider(new com.sun.crypto.provider.SunJCE());
byte [] keyByte = ssoKey.getBytes();

SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede");
DESedeKeySpec desKeySpec = new DESedeKeySpec(keyByte);
SecretKey secretKey = keyFactory.generateSecret(desKeySpec);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 24 2003
Added on Mar 14 2002
2 comments
1,684 views