Class DefaultSensitiveStringCodec
- java.lang.Object
-
- org.apache.activemq.artemis.utils.DefaultSensitiveStringCodec
-
- All Implemented Interfaces:
SensitiveDataCodec<String>
public class DefaultSensitiveStringCodec extends Object implements SensitiveDataCodec<String>
A DefaultSensitiveDataCodec The default implementation of SensitiveDataCodec. This class is used when the user indicates in the config file to use a masked password but doesn't give a codec implementation. It supports one-way hash (digest) and two-way (encrypt-decrpt) algorithms The two-way uses "Blowfish" algorithm The one-way uses "PBKDF2" hash algorithm
-
-
Field Summary
Fields Modifier and Type Field Description static StringALGORITHMstatic StringBLOWFISH_KEYstatic StringKEY_SYSTEM_PROPERTYstatic StringONE_WAYstatic StringTWO_WAY
-
Constructor Summary
Constructors Constructor Description DefaultSensitiveStringCodec()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdecode(Object secret)Stringencode(Object secret)static StringenvVarNameFromSystemPropertyName(String systemPropertyName)protected StringgetFromEnv(String envVarName)voidinit(Map<String,String> params)static voidmain(String[] args)This main class is as documented on configuration-index.md, where the user can mask the password here.booleanverify(char[] inputValue, String storedValue)
-
-
-
Field Detail
-
ALGORITHM
public static final String ALGORITHM
- See Also:
- Constant Field Values
-
BLOWFISH_KEY
public static final String BLOWFISH_KEY
- See Also:
- Constant Field Values
-
ONE_WAY
public static final String ONE_WAY
- See Also:
- Constant Field Values
-
TWO_WAY
public static final String TWO_WAY
- See Also:
- Constant Field Values
-
KEY_SYSTEM_PROPERTY
public static final String KEY_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
decode
public String decode(Object secret) throws Exception
- Specified by:
decodein interfaceSensitiveDataCodec<String>- Throws:
Exception
-
encode
public String encode(Object secret) throws Exception
- Specified by:
encodein interfaceSensitiveDataCodec<String>- Throws:
Exception
-
init
public void init(Map<String,String> params) throws Exception
- Specified by:
initin interfaceSensitiveDataCodec<String>- Throws:
Exception
-
main
public static void main(String[] args) throws Exception
This main class is as documented on configuration-index.md, where the user can mask the password here. *- Parameters:
args-- Throws:
Exception
-
verify
public boolean verify(char[] inputValue, String storedValue)- Specified by:
verifyin interfaceSensitiveDataCodec<String>
-
-