How to Specify a java.security.Security
Property
Some aspects of JSSE may be customized by setting security properties.
You can set a security property either statically or dynamically:
- To set a security property statically, add a line to the security properties file. The security
properties file is located at:
where<install_dir>/jre/lib/security/java.security
<install_dir>
refers to the directory where the runtime environment is installed.To specify a security property value in the security properties file, you add a line of the following form:propertyName=propertyValue
For example, suppose you want to specify a different key manager factory algorithm name than theIbmX509
default. You do this by specifying the algorithm name as the value of a security property namedssl.KeyManagerFactory.algorithm
. Suppose you want to set the value toMyX509
. To do so, place the following in the security properties file:ssl.KeyManagerFactory.algorithm=MyX509
- To set a security property dynamically, call the
java.security.Security.setProperty
method in your code substituting the appropriate property name and value:
For example, aSecurity.setProperty(propertyName, "propertyValue");
setProperty
call corresponding to the previous example for specifying the key manager factory algorithm name would be:Security.setProperty("ssl.KeyManagerFactory.algorithm","MyX509");