Class PasswordValue
java.lang.Object
ghidra.formats.gfilesystem.crypto.PasswordValue
- All Implemented Interfaces:
Closeable
,AutoCloseable
Wrapper for a password, held in a char[] array.
Closing
an instance will clear the characters of the char array.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
void
close()
Clears the password characters by overwriting them with '\0's.static PasswordValue
copyOf
(char[] password) Creates a new PasswordValue using a copy the specified characters.boolean
char[]
Returns a reference to the current password characters.int
hashCode()
static PasswordValue
wrap
(char[] password) Creates a new PasswordValue by wrapping the specified character array.
-
Method Details
-
copyOf
Creates a new PasswordValue using a copy the specified characters.- Parameters:
password
- password characters- Returns:
- new PasswordValue instance
-
wrap
Creates a new PasswordValue by wrapping the specified character array.The new instance will take ownership of the char array, and clear it when the instance is
closed
.- Parameters:
password
- password characters- Returns:
- new PasswordValue instance
-
clone
-
close
public void close()Clears the password characters by overwriting them with '\0's.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getPasswordChars
public char[] getPasswordChars()Returns a reference to the current password characters.- Returns:
- reference to the current password characters
-
hashCode
public int hashCode() -
equals
-