Package org.nuxeo.common.codec
Class CryptoProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<Object,Object>
-
- java.util.Properties
-
- org.nuxeo.common.codec.CryptoProperties
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,Object>
public class CryptoProperties extends Properties
Properties
with crypto capabilities.
The cryptographic algorithms depend on:- Environment.SERVER_STATUS_KEY
- Environment.CRYPT_KEYALIAS && Environment.CRYPT_KEYSTORE_PATH || getProperty(Environment.JAVA_DEFAULT_KEYSTORE)
- Environment.CRYPT_KEY
- Since:
- 7.4
- See Also:
Crypto
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
CryptoProperties.PropertiesGetDefaults
-
Field Summary
-
Fields inherited from class java.util.Properties
defaults
-
-
Constructor Summary
Constructors Constructor Description CryptoProperties()
CryptoProperties(Properties defaults)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Crypto
getCrypto()
String
getProperty(String key)
String
getProperty(String key, boolean raw)
String
getRawProperty(String key)
String
getRawProperty(String key, String defaultValue)
Searches for the property with the specified key in this property list.void
load(InputStream inStream)
void
load(Reader reader)
void
loadFromXML(InputStream in)
Object
merge(Object key, Object value, BiFunction<? super Object,? super Object,? extends Object> remappingFunction)
Object
put(Object key, Object value)
void
putAll(Map<? extends Object,? extends Object> t)
Object
putIfAbsent(Object key, Object value)
Object
remove(Object key)
boolean
remove(Object key, Object value)
Object
replace(Object key, Object value)
boolean
replace(Object key, Object oldValue, Object newValue)
-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, hashCode, isEmpty, keys, keySet, list, list, propertyNames, rehash, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
-
-
-
Constructor Detail
-
CryptoProperties
public CryptoProperties(Properties defaults)
-
CryptoProperties
public CryptoProperties()
-
-
Method Detail
-
getCrypto
public Crypto getCrypto()
-
load
public void load(Reader reader) throws IOException
- Overrides:
load
in classProperties
- Throws:
IOException
-
load
public void load(InputStream inStream) throws IOException
- Overrides:
load
in classProperties
- Throws:
IOException
-
loadFromXML
public void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException
- Overrides:
loadFromXML
in classProperties
- Throws:
IOException
InvalidPropertiesFormatException
-
putIfAbsent
public Object putIfAbsent(Object key, Object value)
- Specified by:
putIfAbsent
in interfaceMap<Object,Object>
- Overrides:
putIfAbsent
in classProperties
-
merge
public Object merge(Object key, Object value, BiFunction<? super Object,? super Object,? extends Object> remappingFunction)
-
getRawProperty
public String getRawProperty(String key)
- Returns:
- the "raw" property: not decrypted if it was provided encrypted
-
getRawProperty
public String getRawProperty(String key, String defaultValue)
Searches for the property with the specified key in this property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns the default value argument if the property is not found.- Returns:
- the "raw" property (not decrypted if it was provided encrypted) or the
defaultValue
if not found - See Also:
Properties.setProperty(java.lang.String, java.lang.String)
-
getProperty
public String getProperty(String key)
- Overrides:
getProperty
in classProperties
-
getProperty
public String getProperty(String key, boolean raw)
- Parameters:
raw
- if the encrypted values must be returned encrypted (raw==true
) or decrypted (raw==false
)- Returns:
- the property value or null
-
-