class MemoryPasswordProvider extends java.lang.Object implements PasswordProvider
This implementation is not very secure because the password data is resident in memory during the life of this
provider object, giving attackers a large window of opportunity to obtain the password from a memory dump.
A slightly more secure implementation is EnvironmentPasswordProvider
,
and an even more secure implementation is FilePasswordProvider
.
Modifier and Type | Field and Description |
---|---|
private char[] |
password |
Constructor and Description |
---|
MemoryPasswordProvider(char[] chars) |
Modifier and Type | Method and Description |
---|---|
void |
clearSecrets() |
char[] |
getPassword()
Returns a new char[] array with the password characters.
|
public char[] getPassword()
PasswordProvider
It is the responsibility of the caller to erase this data by calling
Arrays.fill(char[], char)
immediately when authentication is complete and the password data
is no longer needed.
getPassword
in interface PasswordProvider
public void clearSecrets()