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
Propertieswith 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 classCryptoProperties.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 CryptogetCrypto()StringgetProperty(String key)StringgetProperty(String key, boolean raw)StringgetRawProperty(String key)StringgetRawProperty(String key, String defaultValue)Searches for the property with the specified key in this property list.voidload(InputStream inStream)voidload(Reader reader)voidloadFromXML(InputStream in)Objectmerge(Object key, Object value, BiFunction<? super Object,? super Object,? extends Object> remappingFunction)Objectput(Object key, Object value)voidputAll(Map<? extends Object,? extends Object> t)ObjectputIfAbsent(Object key, Object value)Objectremove(Object key)booleanremove(Object key, Object value)Objectreplace(Object key, Object value)booleanreplace(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:
loadin classProperties- Throws:
IOException
-
load
public void load(InputStream inStream) throws IOException
- Overrides:
loadin classProperties- Throws:
IOException
-
loadFromXML
public void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException
- Overrides:
loadFromXMLin classProperties- Throws:
IOExceptionInvalidPropertiesFormatException
-
putIfAbsent
public Object putIfAbsent(Object key, Object value)
- Specified by:
putIfAbsentin interfaceMap<Object,Object>- Overrides:
putIfAbsentin 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
defaultValueif not found - See Also:
Properties.setProperty(java.lang.String, java.lang.String)
-
getProperty
public String getProperty(String key)
- Overrides:
getPropertyin 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
-
-