You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.




org.mozilla.jss.util
Class ConsolePasswordCallback

java.lang.Object
  extended by org.mozilla.jss.util.ConsolePasswordCallback
All Implemented Interfaces:
PasswordCallback

public class ConsolePasswordCallback
extends java.lang.Object
implements PasswordCallback

A password callback that obtains its password from the console. Asterisks are echoed at the prompt.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mozilla.jss.util.PasswordCallback
PasswordCallback.GiveUpException
 
Constructor Summary
ConsolePasswordCallback()
           
 
Method Summary
 Password getPasswordAgain(PasswordCallbackInfo token)
          Tries supplying a password again.
 Password getPasswordFirstAttempt(PasswordCallbackInfo info)
          Supplies a password.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsolePasswordCallback

public ConsolePasswordCallback()
Method Detail

getPasswordFirstAttempt

public Password getPasswordFirstAttempt(PasswordCallbackInfo info)
                                 throws PasswordCallback.GiveUpException
Description copied from interface: PasswordCallback
Supplies a password. This is called on the first attempt; if it returns the wrong password, getPasswordAgain will be called on subsequent attempts.

Specified by:
getPasswordFirstAttempt in interface PasswordCallback
Parameters:
info - Information about the token that is being logged into.
Returns:
The password. This password object is owned by and will be cleared by the caller.
Throws:
PasswordCallback.GiveUpException - If the callback does not want to supply a password.

getPasswordAgain

public Password getPasswordAgain(PasswordCallbackInfo token)
                          throws PasswordCallback.GiveUpException
Description copied from interface: PasswordCallback
Tries supplying a password again. This callback will be called if the first callback returned an invalid password. It will be called repeatedly until it returns a correct password, or it gives up by throwing a GiveUpException.

Specified by:
getPasswordAgain in interface PasswordCallback
Parameters:
token - Information about the token that is being logged into.
Returns:
The password. This password object is owned by and will be cleared by the caller.
Throws:
PasswordCallback.GiveUpException - If the callback does not want to supply a password. This may often be the case if the first attempt failed.