|
For the latest news and information visit The GNU Crypto project |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.crypto.util.ExpirableObject
gnu.crypto.auth.Password
Immutible, though destroyable, password class.
Extends ExpirableObject
, implementing doDestroy()
in which encapsulated char[]
, and byte[]
password fields
are cleared (elements set to zero) in order to thwart memory heap
snooping.
Field Summary |
---|
Fields inherited from class gnu.crypto.util.ExpirableObject |
---|
DEFAULT_TIMEOUT |
Constructor Summary | |
---|---|
Password(byte[] password)
Create a new expirable Password object that will expire after the default timeout ExpirableObject.DEFAULT_TIMEOUT . |
|
Password(byte[] password,
int offset,
int length)
Create a new expirable Password object that will expire after the default timeout ExpirableObject.DEFAULT_TIMEOUT . |
|
Password(byte[] password,
int offset,
int length,
long delay)
Create a new expirable Password object that will expire after the timeout denoted by constructor parameter, delay. |
|
Password(byte[] password,
long delay)
Create a new expirable Password object that will expire after the timeout denoted by constructor parameter, delay. |
|
Password(char[] password)
Create a new expirable Password object that will expire after the default timeout ExpirableObject.DEFAULT_TIMEOUT . |
|
Password(char[] password,
int offset,
int length)
Create a new expirable Password object that will expire after the default timeout ExpirableObject.DEFAULT_TIMEOUT . |
|
Password(char[] password,
int offset,
int length,
long delay)
Create a new expirable Password object that will expire after the timeout denoted by constructor parameter, delay. |
|
Password(char[] password,
long delay)
Create a new expirable Password object that will expire after the timeout denoted by constructor parameter, delay. |
Method Summary | |
---|---|
protected void |
doDestroy()
Sets password field char[], and byte[] array elements to zero. |
byte[] |
getBytes()
Returns a reference to the byte[] password storage field,
bPassword . |
char[] |
getPassword()
Returns a reference to the char[] password storage field,
password . |
boolean |
isDestroyed()
Returns true, or false relative to whether, or not this object's doDestroy() method has been called. |
Methods inherited from class gnu.crypto.util.ExpirableObject |
---|
destroy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Password(char[] password)
ExpirableObject.DEFAULT_TIMEOUT
.
password
- The character array password to associate with this
Password object.public Password(char[] password, long delay)
password
- The character array password to associate with this
Password object.delay
- The number of miliseconds before this Password object
will be automatically destroyed.public Password(char[] password, int offset, int length)
ExpirableObject.DEFAULT_TIMEOUT
.
password
- The character array password to associate with this
Password object.offset
- The password character array parameter element
marking the beginning of the contained password string.length
- The number of characters, beginning at offset,
to be copied into this object's password
field.public Password(char[] password, int offset, int length, long delay)
password
- The character array password to associate with this
Password object.offset
- The password character array parameter element
marking the beginning of the contained password string.length
- The number of characters, beginning at offset,
to be copied into this object's password
field.delay
- The number of miliseconds before this Password object
will be automatically destroyed.public Password(byte[] password)
ExpirableObject.DEFAULT_TIMEOUT
.
password
- The byte array password to associate with this
Password object.public Password(byte[] password, long delay)
password
- The byte array password to associate with this
Password object.delay
- The number of miliseconds before this Password object
will be automatically destroyed.public Password(byte[] password, int offset, int length)
ExpirableObject.DEFAULT_TIMEOUT
.
password
- The byte array password to associate with this
Password object.offset
- The password byte array parameter element
marking the beginning of the contained password string.length
- The number of bytes, beginning at offset,
to be copied into this object's password
field.public Password(byte[] password, int offset, int length, long delay)
password
- The byte array password to associate with this
Password object.offset
- The password byte array parameter element
marking the beginning of the contained password string.length
- The number of bytes, beginning at offset,
to be copied into this object's bPassword
field.delay
- The number of miliseconds before this Password object
will be automatically destroyed.Method Detail |
public char[] getPassword()
char[]
password storage field,
password
.
public byte[] getBytes()
byte[]
password storage field,
bPassword
.
protected void doDestroy()
ExpirableObject
abstract
method, ExpirableObject.doDestroy()
. See also,
ExpirableObject.destroy()
.
doDestroy
in class ExpirableObject
public boolean isDestroyed()
doDestroy()
method has been called. See also,
.
|
For the latest news and information visit The GNU Crypto project |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |