Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot set up certs for trusted CAs: PrivilegedActionException  RSS feed

Anand Wadhwani
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I get following exception while getting instance of cipher:

java.lang.ExceptionInInitializerError: java.lang.SecurityException: Cannot set up certs for trusted CAs:
at javax.crypto.SunJCE_b.<clinit>(DashoA6275)
at javax.crypto.Cipher.a(DashoA6275)
at javax.crypto.Cipher.getInstance(DashoA6275)
at EncryptionDecryptionUtil.encryptData(

I am running this code under tomcat/jdk 1.2.2 environment. I am using SunJCE provider (jce_1_2_2.jar and sunjce_provider.jar) on the classpath.

For above problem I have tried following things:

1. Updated local JDK 1.2 policy file to grant javax.crypto.CryptoAllPermission permission
2. Tried Security.addProvider / Security.insertProviderAt
//Security.addProvider(new com.sun.crypto.provider.SunJCE());
Security.insertProviderAt(new com.sun.crypto.provider.SunJCE(), 2);

But problem remains same.

Thanks for help!
Anand Wadhwani
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fortunately we were able to solve the problem. We were having this problem on AS400 server and on local PC(WSAD) environment as well.

To resolve on AS400 all we needed is to put the jars under JRE's ext directory: /qibm/ProdData/Java400/jdk13/lib/ext

The problem on local PC in WSAD environment was that JCE license had expired, here are the steps to resolve:

$JAVA_HOME = C:\Program Files\Application Developer\v5.1\runtimes\base_v5\java

1. Go to $JAVA_HOME/jre/lib/security directory --- You should find the file Edit the file to add the following line to the list of providers:


The new list looks like this:

# List of providers and their preference orders (see above):

This adds the provider SunJCE to the list of providers.

2. Copy the following files to jre/lib/ext directory:


3. Additional thing you might want to do is to add following line (as last permission in grant block) in "java.policy" file under $JAVA_HOME/jre/lib/security folder:

permission javax.crypto.CryptoAllPermission;

4. Close all WSAD instances
5. Create a folder �update� in C:\Program Files\IBM\Application Developer\v5.1\runtimes\base_v5
6. Download the �� file from
Take the file from CVS location �\VSA\Construction\Components\Blowfish�
7. Extract this zip file to �update� directory.
8. Open Command Directory
9. Change the directory location to C:\Program Files\IBM\Application Developer\v5.1\runtimes\base_v5\bin
10. Run setupCmdLine.bat. This is used for setting up the environment.
11. In the same command prompt, change the directory to C:\Program Files\IBM\Application Developer\v5.1\runtimes\base_v5\update
12. Run updateWizard.bat
13. WSAD application installer will pop up in sometime (2-3 Minutes)
14. Select language as English
15. If the installation package is not shown, check the box and manually enter �C:\Program Files\IBM\Application Developer\v5.1\runtimes\base_v5� Do not use Browse.
16. Choose Option �Install Fix Packs� and click Next
17. Check the Fix directory. It should point to �C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1\runtimes\base_v5\update\fixpacks� and click next.
18. Select Fix pack to install and you are done. It will take about 5-10 minutes to update the files. Once it is done, start the WSAD and the server.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!