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:
    <install_dir>/jre/lib/security/java.security
    where <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 the IbmX509 default. You do this by specifying the algorithm name as the value of a security property named ssl.KeyManagerFactory.algorithm. Suppose you want to set the value to MyX509. 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:
    Security.setProperty(propertyName, "propertyValue");
    For example, a setProperty call corresponding to the previous example for specifying the key manager factory algorithm name would be:
    Security.setProperty("ssl.KeyManagerFactory.algorithm","MyX509");