Package com.hazelcast.config.replacer
Class EncryptionReplacer
java.lang.Object
com.hazelcast.config.replacer.AbstractPbeReplacer
com.hazelcast.config.replacer.EncryptionReplacer
- All Implemented Interfaces:
ConfigReplacer
This class is an example
ConfigReplacer implementation which decrypts
encrypted values.
The main(String...) method is provided to generate the encrypted variables.
This class extends AbstractPbeReplacer where the main encryption logic is located. This class implements
getPassword() method and depending on configuration allows to use a password file and/or user properties (name and
HOME) and/or network interface properties (MAC address).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringReplacer property name to configure path to a password file which content should be used as part of the encryption password.static final StringReplacer property name to configure network interface name used to retrieve MAC address used as part of the encryption password.static final StringReplacer property name to configuretrue/falseflag controlling if users properties should be used as part of the encryption password.Fields inherited from class com.hazelcast.config.replacer.AbstractPbeReplacer
DEFAULT_CIPHER_ALGORITHM, DEFAULT_SECRET_KEY_FACTORY_ALGORITHM, PROPERTY_CIPHER_ALGORITHM, PROPERTY_KEY_LENGTH_BITS, PROPERTY_SALT_LENGTH_BYTES, PROPERTY_SECRET_KEY_ALGORITHM, PROPERTY_SECRET_KEY_FACTORY_ALGORITHM, PROPERTY_SECURITY_PROVIDER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Stringprotected char[]Provides password for a chosen SecretKeyFactory.Variable replacer prefix string.voidinit(Properties properties) Initialization method called before first usage of the config replacer.static final voidMethods inherited from class com.hazelcast.config.replacer.AbstractPbeReplacer
decrypt, encrypt, getReplacement
-
Field Details
-
PROPERTY_PASSWORD_USER_PROPERTIES
Replacer property name to configuretrue/falseflag controlling if users properties should be used as part of the encryption password.- See Also:
-
PROPERTY_PASSWORD_NETWORK_INTERFACE
Replacer property name to configure network interface name used to retrieve MAC address used as part of the encryption password.- See Also:
-
PROPERTY_PASSWORD_FILE
Replacer property name to configure path to a password file which content should be used as part of the encryption password.- See Also:
-
-
Constructor Details
-
EncryptionReplacer
public EncryptionReplacer()
-
-
Method Details
-
init
Description copied from interface:ConfigReplacerInitialization method called before first usage of the config replacer.- Specified by:
initin interfaceConfigReplacer- Overrides:
initin classAbstractPbeReplacer- Parameters:
properties- properties configured (notnull)
-
getPrefix
Description copied from interface:ConfigReplacerVariable replacer prefix string. The value returned should be a constant unique short alphanumeric string without whitespaces.- Returns:
- constant prefix of this replacer
-
getPassword
protected char[] getPassword()Description copied from class:AbstractPbeReplacerProvides password for a chosen SecretKeyFactory.- Specified by:
getPasswordin classAbstractPbeReplacer- Returns:
- password must not be
nullor empty
-
main
- Throws:
Exception
-
encrypt
- Throws:
Exception
-