Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.security.auth
Class Password  view Password download Password.java

java.lang.Object
  extended bygnu.java.security.util.ExpirableObject
      extended bygnu.javax.security.auth.Password
All Implemented Interfaces:
javax.security.auth.Destroyable

public final class Password
extends gnu.java.security.util.ExpirableObject

Immutible, though destroyable, password class.

Extends gnu.java.security.util.ExpirableObject, implementing doDestroy() 55 in which encapsulated char[], and byte[] password fields are cleared (elements set to zero) in order to thwart memory heap snooping.


Nested Class Summary
 
Nested classes inherited from class gnu.java.security.util.ExpirableObject
 
Field Summary
private  byte[] bPassword
          Password stored in byte[] format.
private  boolean mIsDestroyed
          Indicates whether this Password object's doDestroy() 55 method has been called.
private  char[] password
          Password stored in char[] format.
 
Fields inherited from class gnu.java.security.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>ExpirableObject.DEFAULT_TIMEOUT 55 .
Password(byte[] password, int offset, int length)
          Create a new expirable Password object that will expire after the default timeout ExpirableObject.DEFAULT_TIMEOUT>ExpirableObject.DEFAULT_TIMEOUT 55 .
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>ExpirableObject.DEFAULT_TIMEOUT 55 .
Password(char[] password, int offset, int length)
          Create a new expirable Password object that will expire after the default timeout ExpirableObject.DEFAULT_TIMEOUT>ExpirableObject.DEFAULT_TIMEOUT 55 .
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() 55 method has been called.
 
Methods inherited from class gnu.java.security.util.ExpirableObject
destroy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

password

private final char[] password
Password stored in char[] format.


bPassword

private final byte[] bPassword
Password stored in byte[] format.


mIsDestroyed

private boolean mIsDestroyed
Indicates whether this Password object's doDestroy() 55 method has been called. See also, ExpirableObject#Destroy().

Constructor Detail

Password

public Password(char[] password)
Create a new expirable Password object that will expire after the default timeout ExpirableObject.DEFAULT_TIMEOUT>ExpirableObject.DEFAULT_TIMEOUT 55 .


Password

public Password(char[] password,
                long delay)
Create a new expirable Password object that will expire after the timeout denoted by constructor parameter, delay.


Password

public Password(char[] password,
                int offset,
                int length)
Create a new expirable Password object that will expire after the default timeout ExpirableObject.DEFAULT_TIMEOUT>ExpirableObject.DEFAULT_TIMEOUT 55 .


Password

public 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

public Password(byte[] password)
Create a new expirable Password object that will expire after the default timeout ExpirableObject.DEFAULT_TIMEOUT>ExpirableObject.DEFAULT_TIMEOUT 55 .


Password

public Password(byte[] password,
                long delay)
Create a new expirable Password object that will expire after the timeout denoted by constructor parameter, delay.


Password

public Password(byte[] password,
                int offset,
                int length)
Create a new expirable Password object that will expire after the default timeout ExpirableObject.DEFAULT_TIMEOUT>ExpirableObject.DEFAULT_TIMEOUT 55 .


Password

public 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.

Method Detail

getPassword

public char[] getPassword()
Returns a reference to the char[] password storage field, password.


getBytes

public byte[] getBytes()
Returns a reference to the byte[] password storage field, bPassword.


doDestroy

protected void doDestroy()
Sets password field char[], and byte[] array elements to zero. This method implements base class gnu.java.security.util.ExpirableObject abstract method, ExpirableObject.doDestroy()>ExpirableObject.doDestroy() 55 . See also, ExpirableObject.destroy()>ExpirableObject.destroy() 55 .


isDestroyed

public boolean isDestroyed()
Returns true, or false relative to whether, or not this object's doDestroy() 55 method has been called. See also, .