public class AMPassword extends AMCallbackHandler implements Cloneable, Serializable
clear should be
called when the password is no longer needed so that the sensitive
information is not left in memory.
A AMPassword can be used as a hard-coded
AMCallbackHandler.
AMCallbackHandler,
Serialized Form| Constructor and Description |
|---|
AMPassword(char[] pw)
Creates a Password from a char array, then wipes the char array.
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
charToByte(char[] charArray)
Converts a char array to a null-terminated byte array using a standard
encoding, which is currently UTF8.
|
Object |
clone()
Clones the password.
|
byte[] |
getByteCopy()
Returns a null-terminated byte array that is the byte-encoding of
this password.
|
char[] |
getChars()
Returns the char array underlying this password.
|
clear, finalize, handle, setPasswordpublic AMPassword(char[] pw)
pw - A char[] containing the password. This array will be
cleared (set to zeroes) by the constructor.public Object clone()
public char[] getChars()
public byte[] getByteCopy()
wipeChars.public static byte[] charToByte(char[] charArray)
wipeBytes, for example).charArray - A character array, which should not be null. It will
be wiped with zeroes.wipeBytes is ideal for this purpose.org.mozilla.jss.util.Password#wipeBytesCopyright © 2010–2023 Open Identity Platform Community. All rights reserved.