Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-29-2008, 06:53 PM
Member
 
Join Date: Jul 2008
Posts: 1
jevans is on a distinguished road
IBM JCE: Cannot set up certs for trusted CAs at javax.crypto.f
I've been struggling for a week or two to get anything in the javax.crypto package to work for me.

Environment:
J2SE 1.4.2, IBM Rational Application Developer 6.0, IBM WebSphere App Server 6.0.2.15 (although that last one's not really relevant for this example problem)

Any program I make that utilizes Java Cryptography gives the following exception:

Quote:
Exception in thread "main" java.lang.ExceptionInInitializerError
at javax.crypto.KeyGenerator.getInstance(Unknown Source)
at DESKeyGenerator.main(DESKeyGenerator.java:18)
Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
at javax.crypto.f.<clinit>(Unknown Source)
... 2 more
Most recommendations I've come across for solving this involved reordering the crytographic service providers in java.security, so here is my current arrangement:

security.provider.1=com.ibm.crypto.provider.IBMJCE
security.provider.2=com.ibm.jsse.IBMJSSEProvider
security.provider.3=com.ibm.jsse2.IBMJSSEProvider2
security.provider.4=com.ibm.security.jgss.IBMJGSSP rovider
security.provider.5=com.ibm.security.cert.IBMCertP ath

Finally, here's an example program that causes the exception:

Code:
import java.security.Key; import java.security.NoSuchAlgorithmException; import java.security.Security; import javax.crypto.KeyGenerator; import com.ibm.crypto.provider.IBMJCE; public class DESKeyGenerator { public static void main(String[] args) { //Security.addProvider(new IBMJCE()); try { KeyGenerator kg = KeyGenerator.getInstance("DES"); Key key = kg.generateKey(); System.out.println("Key format: " + key.getFormat()); System.out.println("Key algorithm: " + key.getAlgorithm()); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } } }
The exception's the same with the Security.addProvider line uncommented.

Any ideas or guidance would be greatly appreciated. Thanks for your time.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-11-2008, 06:36 PM
Nicholas Jordan's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Southwest
Posts: 880
Nicholas Jordan is on a distinguished road
I'm not awake yet, and having a bad hair day, but are you sure you want to use DES?

and
Code:
javax.crypto.f.<clinit>(Unknown Source)
what is f?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Uncaught exception java/lang/NoClassDefFoundError: org/bouncycastle/crypto/BlockCiphe Dhiraj.karalkar CLDC and MIDP 2 07-13-2008 07:46 PM
javax.microedition.io/ javax.bluetooth ahtiven New To Java 0 01-20-2008 03:38 PM
java.security.cert.CertificateException: Couldn't find trusted certificate Felissa Enterprise JavaBeans 4 08-11-2007 12:09 AM
map javax.swing.text.Element to javax.swing.text.View elizabeth New To Java 1 07-30-2007 09:02 PM
java.security.cert.CertificateException: Couldn't find trusted certificate Marcus Advanced Java 2 07-03-2007 07:17 PM


All times are GMT +3. The time now is 07:46 AM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org