Package com.hazelcast.config.replacer
Class EncryptionReplacer
- java.lang.Object
-
- com.hazelcast.config.replacer.AbstractPbeReplacer
-
- com.hazelcast.config.replacer.EncryptionReplacer
-
- All Implemented Interfaces:
ConfigReplacer
public class EncryptionReplacer extends AbstractPbeReplacer
This class is an exampleConfigReplacer
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 implementsgetPassword()
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
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_PASSWORD_FILE
Replacer property name to configure path to a password file which content should be used as part of the encryption password.static java.lang.String
PROPERTY_PASSWORD_NETWORK_INTERFACE
Replacer property name to configure network interface name used to retrieve MAC address used as part of the encryption password.static java.lang.String
PROPERTY_PASSWORD_USER_PROPERTIES
Replacer property name to configuretrue
/false
flag contolling 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 Constructor Description EncryptionReplacer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static java.lang.String
encrypt(java.lang.String... args)
protected char[]
getPassword()
Provides password for a chosen SecretKeyFactory.java.lang.String
getPrefix()
Variable replacer prefix string.void
init(java.util.Properties properties)
Initialization method called before first usage of the config replacer.static void
main(java.lang.String... args)
-
Methods inherited from class com.hazelcast.config.replacer.AbstractPbeReplacer
decrypt, encrypt, getReplacement
-
-
-
-
Field Detail
-
PROPERTY_PASSWORD_USER_PROPERTIES
public static final java.lang.String PROPERTY_PASSWORD_USER_PROPERTIES
Replacer property name to configuretrue
/false
flag contolling if users properties should be used as part of the encryption password.- See Also:
- Constant Field Values
-
PROPERTY_PASSWORD_NETWORK_INTERFACE
public static final java.lang.String 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:
- Constant Field Values
-
PROPERTY_PASSWORD_FILE
public static final java.lang.String 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:
- Constant Field Values
-
-
Method Detail
-
init
public void init(java.util.Properties properties)
Description copied from interface:ConfigReplacer
Initialization method called before first usage of the config replacer.- Specified by:
init
in interfaceConfigReplacer
- Overrides:
init
in classAbstractPbeReplacer
- Parameters:
properties
- properties configured (notnull
)
-
getPrefix
public java.lang.String getPrefix()
Description copied from interface:ConfigReplacer
Variable 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:AbstractPbeReplacer
Provides password for a chosen SecretKeyFactory.- Specified by:
getPassword
in classAbstractPbeReplacer
- Returns:
- password must not be
null
or empty
-
main
public static final void main(java.lang.String... args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
encrypt
protected static java.lang.String encrypt(java.lang.String... args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-