BouncyCastle install

Sort:
You are not authorized to post a reply.
Author
Messages
Roger French
Veteran Member
Posts: 545
Veteran Member

    I'm installing (or actually reinstalling) bouncy castle for a 9.0 env on windows platform. When I run the regression tests, the crypto.out file is:

    java.lang.NoClassDefFoundError: org/bouncycastle/crypto/test/RegressionTest
    Exception in thread "main"

    The command I'm using is:

    C:\JDK5\bin>%JAVA_HOME%/bin/java -cp bctest-jdk15-138.jar org.bouncycastle.crypto.test.RegressionTest > crypto.out 2>&1

    Ok, I have not changed any Java or Bouncy Castle settings. I am running Java 1.5._38.JAVA_HOMEis set correctly. I've madethechanges to the security policies as stated in the documentation.

    Yes, and it (bouncy castle) used to work "before", but now I don't know what is the problem,and I have the only access to the box.

     

    Any ideas?

    TIA,

    Roger

    John Henley
    Senior Member
    Posts: 3349
    Senior Member
      Where is your bctest-jdk15-138.jar ? Make sure you're in the same directory...
      Thanks for using the LawsonGuru.com forums!
      John
      subserved
      Basic Member
      Posts: 9
      Basic Member
        I am also running into the same problem. Getting the message in notepad:

        java.lang.NoClassDefFoundError: org/bouncycastle/crypto/DataLengthException
        at org.bouncycastle.crypto.test.RegressionTest.(Unknown Source)
        Exception in thread "main"

        The test file bctest-jdk15-140.jar is located in the BCTestDir Directory where I am running the command. Version of Java I am running is JDK 5.0 Update 11. Any suggestions?
        Jimmy Chiu
        Veteran Member
        Posts: 641
        Veteran Member

          Did you apply BC to both JDK and JRE? I usually just do both of them to avoid any confusions. You may also wanna check under command prompt.

          which java

          and see if it's using the correct path for your JDK5\bin\java.exe

          subserved
          Basic Member
          Posts: 9
          Basic Member
            Did apply BC to JDK & JRE under the java.security file located jre/lib/security and /lib/security.

            Here are the providers and their preference orders:

            List of providers and their preference orders (see above):
            #
            security.provider.1=sun.security.provider.Sun
            security.provider.2=sun.security.rsa.SunRsaSign
            security.provider.3=com.sun.net.ssl.internal.ssl.Provider
            security.provider.4=com.sun.crypto.provider.SunJCE
            security.provider.5=sun.security.jgss.SunProvider
            security.provider.6=com.sun.security.sasl.Provider
            security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider

            When I do "which java" the correct path is C:/JDK5/bin/java.exe.

            The only thing I can think of is moving the order of the java.security file. Also, one last thing I did to see if it resolved it. I tried Java Version 5 Release 16 but get the same error. Wasn't sure if the JCE files made a difference or not.
            subserved
            Basic Member
            Posts: 9
            Basic Member
              Disregard my last. I got it working. Just having a problem now with the regression testing on WAS. There are two errors in the results of the test. Any ideas?

              CertTest: error setting up keys - java.security.NoSuchProviderException: no such provider: SUN

              and

              SlotTwo: BC provider not returned for DESede/CTR/NoPadding got IBMJCE

              Should I be concerned about these?
              Jimmy Chiu
              Veteran Member
              Posts: 641
              Veteran Member

                The timestamp on the WAS/JDK JCE Provider should be 6/5/2008 11:06am for the 2 files, (local_policy.jar/US_export_policy.jar). Do you have the latest one? I just ran the crypto.out and I see no error on my WAS FP17.

                subserved
                Basic Member
                Posts: 9
                Basic Member
                  Looking at the policy files for WAS, shows 9/29 which is when I downloaded the files. The size shows 3.63 KB (3,726 bytes). Does this match up with yours?
                  Jimmy Chiu
                  Veteran Member
                  Posts: 641
                  Veteran Member
                    local policy 3726, us export policy 3715
                    subserved
                    Basic Member
                    Posts: 9
                    Basic Member
                      Jimmy,

                      I was able to get it working. Thank you.
                      Any ideas?
                      Basic Member
                      Posts: 20
                      Basic Member
                        Regression test to check the JDK configuration works fine without any errors. But while doing the regression test for WAS - there was no response from java.exe. I ran the following command
                        %WAS_HOME%/java/bin/java -cp bctest-jdk15-139.jar org.bouncycastle.crypto.test.RegressionTest

                        I have placed the bctest-jdk15-139.jar & bcprov-jdk15-139.jar files in jre/lib/ext folder.

                        I have the latest local_policy.jar and US_export_policy.jar from IBM JCE. I have setup the java.security settings as per the documentation.



                        Any ideas?
                        Basic Member
                        Posts: 20
                        Basic Member
                          java.security is made like below,,

                          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=org.bouncycastle.jce.provider.BouncyCastleProvider
                          security.provider.5=com.ibm.security.jgss.IBMJGSSProvider
                          security.provider.6=com.ibm.security.cert.IBMCertPath
                          security.provider.7=com.ibm.crypto.pkcs11.provider.IBMPKCS11
                          security.provider.8=com.ibm.security.cmskeystore.CMSProvider
                          security.provider.9=com.ibm.security.jgss.mech.spnego.IBMSPNEGO
                          Any ideas?
                          Basic Member
                          Posts: 20
                          Basic Member
                            could any one help me out in configuring the bouncy castle in WAS?
                            You are not authorized to post a reply.