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()voidclose()Clears the password characters by overwriting them with '\0's.static PasswordcopyOf(char[] password) Creates a newPasswordusing a copy the specified characters.booleanchar[]Returns a reference to the current password characters.inthashCode()static Passwordwrap(char[] password) Creates a newPasswordby wrapping the specified character array.
-
Method Details
-
copyOf
Creates a newPasswordusing a copy the specified characters.- Parameters:
password- password characters- Returns:
- new
Passwordinstance
-
wrap
Creates a newPasswordby 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
Passwordinstance
-
clone
-
close
public void close()Clears the password characters by overwriting them with '\0's.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein 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
-