Results 1 to 2 of 2
  1. #1
    jevans is offline Member
    Join Date
    Jul 2008
    Rep Power

    Default 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.

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

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

    Exception in thread "main" java.lang.ExceptionInInitializerError
    at javax.crypto.KeyGenerator.getInstance(Unknown Source)
    at DESKeyGenerator.main(
    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, so here is my current arrangement: rovider ath

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

    Java Code:
    import javax.crypto.KeyGenerator;
    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) {
    The exception's the same with the Security.addProvider line uncommented.

    Any ideas or guidance would be greatly appreciated. Thanks for your time.

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Rep Power


    I'm not awake yet, and having a bad hair day, but are you sure you want to use DES?

    Java Code:
    javax.crypto.f.<clinit>(Unknown Source)
    what is f?
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Similar Threads

  1. Replies: 3
    Last Post: 01-14-2010, 08:45 PM
  2. javax.bluetooth
    By ahtiven in forum New To Java
    Replies: 3
    Last Post: 01-13-2009, 03:54 PM
  3. Replies: 2
    Last Post: 07-13-2008, 05:46 PM
  4. Replies: 4
    Last Post: 08-10-2007, 10:09 PM
  5. map javax.swing.text.Element to javax.swing.text.View
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 07-30-2007, 07:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts