All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.panels.PasswordPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----com.sun.wizards.core.WizardComponent
|
+----com.sun.wizards.core.WizardLeaf
|
+----com.sun.wizards.panels.QueryPanel
|
+----com.sun.wizards.panels.PasswordPanel
- public class PasswordPanel
- extends QueryPanel
The PasswordPanel presents the user with the option to enter a
password. Only if the user enters the correct password will he be
able to continue. The algorithm, provider, and character-to-byte
encoding scheme can be specified via the appropriate constructor.
The plaintext password provided in the constructor is digested and
stored in the serialized panel, but the plaintext is discarded. If
desired, a pre-hashed password can be provided.
The password can also be provided in a statefile. The
password should be stored under the WizardState key
wizard.password.
-
PasswordPanel()
- Creates a PasswordPanel with no name.
-
PasswordPanel(String, Route, WizardTreeManager)
- Creates a PasswordPanel with the specified name, the specified
route and wizard manager.
-
PasswordPanel(WizardState, String, String)
-
Creates a PasswordPanel with the specified name for the
specified application, using the specified algorithm to
compute the hashed password.
-
PasswordPanel(WizardState, String, String, String, String, String)
- Creates a PasswordPanel with the specified name for the
specified application, using the specified algorithm to
compute the hashed password.
-
addCriticalStateKeys(Vector)
-
Adds the WizardState keys that should be set into the
WizardState file.
-
addRuntimeResources(Vector)
- Get the runtime classes required by this panel.
-
compare(byte[], byte[])
- Compares two byte arrays.
-
deserialize(DataInput)
- Deserialize this panel from the specified input stream.
-
digestString(String, String, String, String)
- Utility method to compute the digest value for a String,
using the given algorithm.
-
getAlgorithm()
- Gets the algorithm of this password panel
-
getEncoding()
- Gets the encoding of this password panel
-
getProvider()
- Gets the provider of this password panel
-
isDisplayComplete()
- Returns true if this PasswordPanel is finished displaying.
-
serialize(DataOutput)
- Serialize this panel to the specified output stream.
-
setAlgorithm(String)
- Sets the algorithm of this password panel
-
setEncoding(String)
- Sets the encoding of this password panel
-
setPassword(String)
- Sets the password of this password panel, encoding it in the
supplied algorithm and encoding.
-
setProvider(String)
- Sets the provider of this password panel
-
skip()
- Causes PasswordPanel to be skipped if a previously-supplied
password (via the
wizard.password setting)
matches.
PasswordPanel
public PasswordPanel()
- Creates a PasswordPanel with no name.
PasswordPanel
public PasswordPanel(String name,
Route route,
WizardTreeManager wizardManager)
- Creates a PasswordPanel with the specified name, the specified
route and wizard manager.
- Parameters:
- name - The name for this PasswordPanel.
- route - The route to the appropriate server
side object.
- wizardManager - The wizard manager responsible for
this component.
PasswordPanel
public PasswordPanel(WizardState wizardState,
String name,
String password)
- Creates a PasswordPanel with the specified name for the
specified application, using the specified algorithm to
compute the hashed password. The password provided is hashed
using the default algorithm, provider, and encoding scheme,
and saved into the serialized panel.
- Parameters:
- wizardState - The buildtime WizardState.
- name - The name for this panel.
- password - The password to check against at runtime.
The cleartext password is not stored.
- See Also:
- MessageDigest
PasswordPanel
public PasswordPanel(WizardState wizardState,
String name,
String password,
String algorithm,
String provider,
String encoding)
- Creates a PasswordPanel with the specified name for the
specified application, using the specified algorithm to
compute the hashed password. The password provided is hashed
using the algorithm, provider, and encoding scheme, and saved
into the serialized panel.
- Parameters:
- wizardState - The buildtime WizardState.
- name - The name for this panel.
- password - The password to check against at runtime.
The cleartext password is not stored.
- provider - The name of the provider to use.
null indicates to use the system's
default provider.
- algorithm - The algorithm to use when comparing the user's
password to the stored, hashed password. Default
value is
"SHA".
- encoding - The Char-To-Byte encoding scheme, or
null if it is desired
to use the platform's default encoding scheme.
- See Also:
- MessageDigest
setPassword
public void setPassword(String password)
- Sets the password of this password panel, encoding it in the
supplied algorithm and encoding. Make sure you set the
algorithm, provider and/or encoding to the desired settings
before calling this method.
- Parameters:
- password - The cleartext password of this password panel.
getAlgorithm
public String getAlgorithm()
- Gets the algorithm of this password panel
- Returns:
- The algorithm of this password panel
setAlgorithm
public void setAlgorithm(String algorithm)
- Sets the algorithm of this password panel
- Parameters:
- algorithm - The algorithm of this password panel
getProvider
public String getProvider()
- Gets the provider of this password panel
- Returns:
- The provider of this password panel
setProvider
public void setProvider(String provider)
- Sets the provider of this password panel
- Parameters:
- provider - The provider of this password panel
getEncoding
public String getEncoding()
- Gets the encoding of this password panel
- Returns:
- The encoding of this password panel
setEncoding
public void setEncoding(String encoding)
- Sets the encoding of this password panel
- Parameters:
- encoding - The encoding of this password panel
digestString
public static byte[] digestString(String string,
String algorithm,
String provider,
String encoding)
- Utility method to compute the digest value for a String,
using the given algorithm. The string is first encoded into
bytes, using given encoding scheme, then the
hashvalue is computed, using the supplied algorithm.
- Parameters:
- string - The string to compute the digest value of
- provider - The name of the provider to use.
null indicates to use the system's
default provider.
- algorithm - The algorithm to use when comparing the user's
password to the stored, hashed password. Default
value is
"SHA".
- encoding - The Char-To-Byte encoding scheme, or
null if it is desired
to use the platform's default encoding scheme.
- See Also:
- MessageDigest
skip
public boolean skip()
- Causes PasswordPanel to be skipped if a previously-supplied
password (via the
wizard.password setting)
matches.
- Returns:
- true if the hashed password String stored under the
WizardState key
wizard.password matches the stored
password, false otherwize.
- Overrides:
- skip in class WizardComponent
isDisplayComplete
public boolean isDisplayComplete()
- Returns true if this PasswordPanel is finished displaying.
This method is used to set the user's selection into the
WizardState before moving to the next panel.
- Returns:
- true if the display of this panel is complete, false otherwise
- Overrides:
- isDisplayComplete in class QueryPanel
compare
public static boolean compare(byte b1[],
byte b2[])
- Compares two byte arrays.
- Parameters:
- b1 - The first byte array
- b2 - The second byte array
- Returns:
- true, if the byte arrays equal (in length and content),
false otherwise.
serialize
protected void serialize(DataOutput out)
- Serialize this panel to the specified output stream.
- Parameters:
- out - The output stream to which this panel will be
serialized.
- Overrides:
- serialize in class QueryPanel
deserialize
protected void deserialize(DataInput in)
- Deserialize this panel from the specified input stream.
- Parameters:
- in - The input stream from which this panel will be
deserialized.
- Overrides:
- deserialize in class QueryPanel
addRuntimeResources
public void addRuntimeResources(Vector resourceVector)
- Get the runtime classes required by this panel.
- Overrides:
- addRuntimeResources in class QueryPanel
addCriticalStateKeys
public void addCriticalStateKeys(Vector keys)
- Adds the WizardState keys that should be set into the
WizardState file.
- Parameters:
- keys - The vector of keys that will be added to the
WizardState file.
- Overrides:
- addCriticalStateKeys in class WizardComponent
All Packages Class Hierarchy This Package Previous Next Index