Package ghidra.framework.generic.auth
Class Password
java.lang.Object
ghidra.framework.generic.auth.Password
- 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 Password
copyOf
(char[] password) Creates a newPassword
using a copy the specified characters.boolean
char[]
Returns a reference to the current password characters.int
hashCode()
static Password
wrap
(char[] password) Creates a newPassword
by wrapping the specified character array.
-
Method Details
-
copyOf
Creates a newPassword
using a copy the specified characters.- Parameters:
password
- password characters- Returns:
- new
Password
instance
-
wrap
Creates a newPassword
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
Password
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
-