Top Description Fields Constructors Methods
org.bouncycastle.util

public Class Properties

extends Object
Class Inheritance
Imports
java.math.BigInteger, java.security.AccessControlException, .AccessController, .PrivilegedAction, .Security, java.util.Collections, .HashMap, .HashSet, .Map, .Set, .StringTokenizer

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 Summary

Modifier and TypeField and Description
public static final String
EMULATE_ORACLE

If set the provider will attempt, where possible, to behave the same way as the oracle one.

private static final ThreadLocal<T>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static BigInteger

Returns:

value of property as a BigInteger, null if not defined.
asBigInteger
(String
name of property.
propertyName
)

Return propertyName as a BigInteger.

public static int

Returns:

value of property, or default if not found, as an int.
asInteger
(String
name of property.
propertyName
,
int
integer to return if property not defined.
defaultValue
)

Return propertyName as an integer, defaultValue used if not defined.

public static Set<String>
asKeySet(String propertyName)

public static String

Returns:

value of property as a String, null if not defined.
getPropertyValue
(final String
name of property.
propertyName
)

Return the String value of the property propertyName.

public static String
getPropertyValue(final String propertyName, String defValue)

public static boolean

Returns:

true if the property is set to "true", false otherwise.
isOverrideSet
(String
the property name for the override.
propertyName
)

Return whether a particular override has been set to true.

public static boolean

Returns:

true if the property is set to the value of isTrue, false otherwise.
isOverrideSetTo
(String
the property name for the override.
propertyName
,
boolean
true if the override should be true, false otherwise.
isTrue
)

Return whether a particular override has been set to false.

private static boolean
private static boolean
public static boolean

Returns:

true if the override was already set true in thread local, false otherwise.
removeThreadOverride
(String
the property name for the override.
propertyName
)

Remove any value for the specified override property for the current thread only.

public static boolean

Returns:

true if the override was already set true, false otherwise.
setThreadOverride
(String
the property name for the override.
propertyName
,
boolean
true if the override should be enabled, false if it should be disabled.
enable
)

Enable the specified override property for the current thread only.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMULATE_ORACLEback to summary
public static final String EMULATE_ORACLE

If set the provider will attempt, where possible, to behave the same way as the oracle one.

threadPropertiesback to summary
private static final ThreadLocal<T> threadProperties

Constructor Detail

Propertiesback to summary
private Properties()

Method Detail

asBigIntegerback to summary
public static BigInteger asBigInteger(String propertyName)

Return propertyName as a BigInteger.

Parameters
propertyName:String

name of property.

Returns:BigInteger

value of property as a BigInteger, null if not defined.

asIntegerback to summary
public static int asInteger(String propertyName, int defaultValue)

Return propertyName as an integer, defaultValue used if not defined.

Parameters
propertyName:String

name of property.

defaultValue:int

integer to return if property not defined.

Returns:int

value of property, or default if not found, as an int.

asKeySetback to summary
public static Set<String> asKeySet(String propertyName)
getPropertyValueback to summary
public static String getPropertyValue(final String propertyName)

Return the String value of the property propertyName. Property valuation starts with java.security, then thread local, then system properties.

Parameters
propertyName:String

name of property.

Returns:String

value of property as a String, null if not defined.

getPropertyValueback to summary
public static String getPropertyValue(final String propertyName, String defValue)
isOverrideSetback to summary
public static boolean isOverrideSet(String propertyName)

Return whether a particular override has been set to true.

Parameters
propertyName:String

the property name for the override.

Returns:boolean

true if the property is set to "true", false otherwise.

isOverrideSetToback to summary
public static boolean isOverrideSetTo(String propertyName, boolean isTrue)

Return whether a particular override has been set to false.

Parameters
propertyName:String

the property name for the override.

isTrue:boolean

true if the override should be true, false otherwise.

Returns:boolean

true if the property is set to the value of isTrue, false otherwise.

isSetFalseback to summary
private static boolean isSetFalse(String p)
isSetTrueback to summary
private static boolean isSetTrue(String p)
removeThreadOverrideback to summary
public static boolean removeThreadOverride(String propertyName)

Remove any value for the specified override property for the current thread only.

Parameters
propertyName:String

the property name for the override.

Returns:boolean

true if the override was already set true in thread local, false otherwise.

setThreadOverrideback to summary
public static boolean setThreadOverride(String propertyName, boolean enable)

Enable the specified override property for the current thread only.

Parameters
propertyName:String

the property name for the override.

enable:boolean

true if the override should be enabled, false if it should be disabled.

Returns:boolean

true if the override was already set true, false otherwise.