Package org.mozilla.jss.util
Interface PasswordCallback
-
- All Known Implementing Classes:
ConsolePasswordCallback,NullPasswordCallback,Password
public interface PasswordCallbackRepresents a password callback, which is called to login to the key database and to PKCS #11 tokens.The simplest implementation of a PasswordCallback is a Password object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPasswordCallback.GiveUpExceptionThis exception is thrown if thePasswordCallbackwants to stop guessing passwords.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PasswordgetPasswordAgain(PasswordCallbackInfo info)Tries supplying a password again.PasswordgetPasswordFirstAttempt(PasswordCallbackInfo info)Supplies a password.
-
-
-
Method Detail
-
getPasswordFirstAttempt
Password getPasswordFirstAttempt(PasswordCallbackInfo info) throws PasswordCallback.GiveUpException
Supplies a password. This is called on the first attempt; if it returns the wrong password,getPasswordAgainwill be called on subsequent attempts.- 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
Password getPasswordAgain(PasswordCallbackInfo info) throws PasswordCallback.GiveUpException
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 aGiveUpException.- 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. This may often be the case if the first attempt failed.
-
-