Adding Bouncy Castle as a Security Provider

To install a provider statically, you need to add it as an entry to the java.security file which can be found in $JAVA_HOME/jre/lib/security/java.security for the JRE/JDK you are using. Look for a list of lines with security.provider.X where X is some number.

At the bottom of the line add:

security.provider.N=org.bouncycastle.jce.provider.BouncyCastleProvider

N is one more than the last number in the list. It is possible to add the provider higher up in the list. If you do this, iWay recommends that you do not add it earlier than position 2 as there are occasionally internal dependencies on the provider at position 1 which may cause some operations by your Java environment to result in errors.

For example:

security.provider.1=sun.security.provider.Sun

security.provider.2=org.bouncycastle.jce.provider.BouncyCastleProvider

To make full use of the provider, you must install the unlimited policy files in the JVM you are using -- these can be downloaded from http://java.sun.com. Be careful if you are using Windows as the JDK install will normally install a JRE and a JDK in two separate places -- generally both of these will need to have the policy files installed in it.


iWay Software