Statically Register JsafeJCE Provider as the Default JCE Provider 3
RSA BSAFE Crypto-J 6.2.5 Troubleshooting Guide
Statically Register JsafeJCE Provider as the Default JCE
Provider
A statically registered Crypto-J JsafeJCE provider can be used without having to
instantiate it, and without having to programmatically add it to the provider list.
Statically registering the JsafeJCE provider as the default, that is, in first position,
allows it to be the default provider of algorithms.
Complete the following to statically register the JsafeJCE provider as the default JCE
provider:
1. Copy the relevant Crypto-J jar file(s) to the
<jdk install directory>/jre/lib/ext directory.
2. Edit the
java.security file found in the
<jdk install directory>/jre/lib/security directory:
a. Add the following line to the beginning of the list of providers:
security.provider.1=com.rsa.jsafe.provider.JsafeJCE
b. Alter the numeric values for all other providers in the list to ensure the
numeric values are contiguous. For example, for Oracle
®
JRE 1.6, the
provider list looks like the following:
security.provider.1=com.rsa.jsafe.provider.JsafeJCE
security.provider.2=sun.security.provider.Sun
security.provider.3=sun.security.rsa.SunRsaSign
security.provider.4=com.sun.net.ssl.internal.ssl.Provider
security.provider.5=com.sun.crypto.provider.SunJCE
security.provider.6=sun.security.jgss.SunProvider
security.provider.7=com.sun.security.sasl.Provider
security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
security.provider.9=sun.security.smartcardio.SunPCSC
security.provider.10=sun.security.mscapi.SunMSCAPI
3. To ensure no other cryptographic providers are available, remove all other JCE
providers. Ensure the numeric values for the remaining providers are contiguous.
For instance, for Oracle JRE 1.6, the provider list looks like the following:
security.provider.1=com.rsa.jsafe.provider.JsafeJCE
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
security.provider.3=sun.security.jgss.SunProvider
security.provider.4=com.sun.security.sasl.Provider
security.provider.5=org.jcp.xml.dsig.internal.dom.XMLDSigRI
security.provider.6=sun.security.smartcardio.SunPCSC
Ensure the JsafeJCE provider is used for all supported cryptographic
operations:
To ensure the JsafeJCE provider is used for all supported cryptographic operations,
explicitly provide the JsafeJCE provider name to cryptographic
getInstance()
calls as demonstrated in the JsafeJCE Samples. For example:
Signature signer = Signature.getInstance(“SHA256WithRSA”, “JsafeJCE”);