Results 1 to 2 of 2
- 07-29-2008, 04:53 PM #1
Member
- Join Date
- Jul 2008
- Posts
- 1
- Rep Power
- 0
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:
Most recommendations I've come across for solving this involved reordering the crytographic service providers in java.security, so here is my current arrangement: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
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:
The exception's the same with the Security.addProvider line uncommented.Java 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(); } } }
Any ideas or guidance would be greatly appreciated. Thanks for your time.
- 10-11-2008, 04:36 PM #2
I'm not awake yet, and having a bad hair day, but are you sure you want to use DES?
andwhat is f?Java Code:javax.crypto.f.<clinit>(Unknown Source)
Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
Similar Threads
-
java.security.cert.CertificateException: Couldn't find trusted certificate
By Marcus in forum Advanced JavaReplies: 3Last Post: 01-14-2010, 07:45 PM -
javax.microedition.io/ javax.bluetooth
By ahtiven in forum New To JavaReplies: 3Last Post: 01-13-2009, 02:54 PM -
Uncaught exception java/lang/NoClassDefFoundError: org/bouncycastle/crypto/BlockCiphe
By Dhiraj.karalkar in forum CLDC and MIDPReplies: 2Last Post: 07-13-2008, 05:46 PM -
java.security.cert.CertificateException: Couldn't find trusted certificate
By Felissa in forum Enterprise JavaBeans (EJB)Replies: 4Last Post: 08-10-2007, 10:09 PM -
map javax.swing.text.Element to javax.swing.text.View
By elizabeth in forum New To JavaReplies: 1Last Post: 07-30-2007, 07:02 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks