Class PasswordValue
- java.lang.Object
-
- ghidra.formats.gfilesystem.crypto.PasswordValue
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class PasswordValue extends java.lang.Object implements java.io.CloseableWrapper for a password, held in a char[] array.Closingan instance will clear the characters of the char array.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PasswordValueclone()voidclose()Clears the password characters by overwriting them with '\0's.static PasswordValuecopyOf(char[] password)Creates a new PasswordValue using a copy the specified characters.booleanequals(java.lang.Object obj)char[]getPasswordChars()Returns a reference to the current password characters.inthashCode()static PasswordValuewrap(char[] password)Creates a new PasswordValue by wrapping the specified character array.
-
-
-
Method Detail
-
copyOf
public static PasswordValue copyOf(char[] password)
Creates a new PasswordValue using a copy the specified characters.- Parameters:
password- password characters- Returns:
- new PasswordValue instance
-
wrap
public static PasswordValue wrap(char[] password)
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
public PasswordValue clone()
- Overrides:
clonein classjava.lang.Object
-
close
public void close()
Clears the password characters by overwriting them with '\0's.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
getPasswordChars
public char[] getPasswordChars()
Returns a reference to the current password characters.- Returns:
- reference to the current password characters
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-