public class PasswordHandler extends java.lang.Object implements AFCallbackHandler
PasswordCallback) if required. Optionally an additional
AFCallbackHandler can be provided to which all other
Callbacks will be forwarded. If this is not provided and another
callback is required, the callback handling will fail.| Modifier and Type | Field and Description |
|---|---|
protected AFCallbackHandler |
furtherHandling
The callback handler for all other callbacks.
|
protected char[] |
password
The password to provide in a
PasswordCallback if required. |
| Constructor and Description |
|---|
PasswordHandler(java.lang.String password)
Creates a callback handler providing the designated password to the
appropriate callbacks.
|
PasswordHandler(java.lang.String password,
AFCallbackHandler furtherHandling)
Creates a callback handler providing the designated password to the
appropriate callbacks.
|
| Modifier and Type | Method and Description |
|---|---|
javax.security.auth.callback.Callback[] |
handle(javax.security.auth.callback.Callback[] callbacks)
This method is similar to
CallbackHandler.handle(Callback[]) but returns the provided callbacks back
to the caller. |
protected final char[] password
PasswordCallback if required.protected final AFCallbackHandler furtherHandling
public PasswordHandler(java.lang.String password)
Callback is required besides
a PasswordCallback, callback handling will fail.password - The password to provide in a PasswordCallback
if required.public PasswordHandler(java.lang.String password,
AFCallbackHandler furtherHandling)
Callback is required besides
a PasswordCallback, these callbacks will be collected and
provided to the designated AFCallbackHandler.password - The password to provide in a PasswordCallback
if required.furtherHandling - The AFCallbackHandler to which all
other callbacks will be forwarded. This may be null
which equals PasswordHandler(String).public javax.security.auth.callback.Callback[] handle(javax.security.auth.callback.Callback[] callbacks)
throws javax.security.auth.callback.UnsupportedCallbackException,
java.io.IOException
AFCallbackHandlerCallbackHandler.handle(Callback[]) but returns the provided callbacks back
to the caller. This allows for calling this method remotely. Note that all
callbacks need to be serialisable. handle in interface AFCallbackHandlercallbacks - The callbacks to be handled by this callback handler.javax.security.auth.callback.UnsupportedCallbackException - If the implementation of this method
does not support one or more of the callbacks specified in the
callbacks parameter, an
UnsupportedCallbackException will be thrown.java.io.IOException - If an input or output error occurs, an
IOException will be thrown.