public final class MechanismUtil extends Object
Modifier and Type | Method and Description |
---|---|
static <S extends Password> |
getPasswordCredential(String userName,
CallbackHandler callbackHandler,
Class<S> passwordType,
String passwordAlgorithm,
AlgorithmParameterSpec matchParameters,
AlgorithmParameterSpec generateParameters,
Supplier<Provider[]> providers)
Get a password from a client or server callback, falling back to clear password if needed.
|
static void |
handleCallbacks(String mechName,
CallbackHandler callbackHandler,
Callback... callbacks)
A varargs wrapper method for callback handler invocation.
|
public static <S extends Password> S getPasswordCredential(String userName, CallbackHandler callbackHandler, Class<S> passwordType, String passwordAlgorithm, AlgorithmParameterSpec matchParameters, AlgorithmParameterSpec generateParameters, Supplier<Provider[]> providers) throws AuthenticationMechanismException
S
- the password typeuserName
- the user name to report for error reporting purposes (must not be null
)callbackHandler
- the callback handler (must not be null
)passwordType
- the password class (must not be null
)passwordAlgorithm
- the password algorithm name (must not be null
)matchParameters
- the optional parameters to match (may be null
)generateParameters
- the optional default parameters to use if the password must be generated (may be null
)providers
- the security providers to use with the PasswordFactory
AuthenticationMechanismException
public static void handleCallbacks(String mechName, CallbackHandler callbackHandler, Callback... callbacks) throws AuthenticationMechanismException, UnsupportedCallbackException
mechName
- the mechanism name to report for error purposescallbackHandler
- the callback handlercallbacks
- the callbacksAuthenticationMechanismException
- if the callback handler fails for some reasonUnsupportedCallbackException
- if the callback handler throws this exceptionCopyright © 2017 JBoss by Red Hat. All rights reserved.