Class Properties

java.lang.Object
org.bouncycastle.util.Properties

public class Properties extends Object
Utility method for accessing properties values - properties can be set in java.security, thread local, and system properties. They are checked for in the same order with checking stopped as soon as a value is found.
  • Field Details

    • EMULATE_ORACLE

      public static final String EMULATE_ORACLE
      If set the provider will attempt, where possible, to behave the same way as the oracle one.
      See Also:
  • Method Details

    • isOverrideSet

      public static boolean isOverrideSet(String propertyName)
      Return whether a particular override has been set to true.
      Parameters:
      propertyName - the property name for the override.
      Returns:
      true if the property is set to "true", false otherwise.
    • isOverrideSetTo

      public static boolean isOverrideSetTo(String propertyName, boolean isTrue)
      Return whether a particular override has been set to false.
      Parameters:
      propertyName - the property name for the override.
      isTrue - true if the override should be true, false otherwise.
      Returns:
      true if the property is set to the value of isTrue, false otherwise.
    • setThreadOverride

      public static boolean setThreadOverride(String propertyName, boolean enable)
      Enable the specified override property for the current thread only.
      Parameters:
      propertyName - the property name for the override.
      enable - true if the override should be enabled, false if it should be disabled.
      Returns:
      true if the override was already set true, false otherwise.
    • removeThreadOverride

      public static boolean removeThreadOverride(String propertyName)
      Remove any value for the specified override property for the current thread only.
      Parameters:
      propertyName - the property name for the override.
      Returns:
      true if the override was already set true in thread local, false otherwise.
    • asInteger

      public static int asInteger(String propertyName, int defaultValue)
      Return propertyName as an integer, defaultValue used if not defined.
      Parameters:
      propertyName - name of property.
      defaultValue - integer to return if property not defined.
      Returns:
      value of property, or default if not found, as an int.
    • asBigInteger

      public static BigInteger asBigInteger(String propertyName)
      Return propertyName as a BigInteger.
      Parameters:
      propertyName - name of property.
      Returns:
      value of property as a BigInteger, null if not defined.
    • asKeySet

      public static Set<String> asKeySet(String propertyName)
    • getPropertyValue

      public static String getPropertyValue(String propertyName)
      Return the String value of the property propertyName. Property valuation starts with java.security, then thread local, then system properties.
      Parameters:
      propertyName - name of property.
      Returns:
      value of property as a String, null if not defined.
    • getPropertyValue

      public static String getPropertyValue(String propertyName, String defValue)