Class ScramMechanism
java.lang.Object
org.wildfly.security.mechanism.scram.ScramMechanism
Implementation of the SCRAM authentication mechanism.
- Author:
- David M. Lloyd
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ScramMechanismstatic final ScramMechanismstatic final ScramMechanismstatic final ScramMechanismstatic final ScramMechanismstatic final ScramMechanismstatic final ScramMechanismstatic final ScramMechanism -
Method Summary
Modifier and TypeMethodDescriptioncreateClient(String authorizationId, CallbackHandler callbackHandler, SecureRandom secureRandom, ChannelBindingCallback bindingCallback, int minimumIterationCount, int maximumIterationCount, Supplier<Provider[]> providers) Create a SCRAM client for this mechanism.createServer(CallbackHandler callbackHandler, SecureRandom random, ChannelBindingCallback bindingCallback, int minimumIterationCount, int maximumIterationCount, Supplier<Provider[]> providers) Create a SCRAM server for this mechanism.intReturns the size of the hash of the SCRAM mechanism.Returns the name of the HMAC algorithm.Returns the name of the message digest algorithm.Returns the name of the password algorithm fromScramDigestPassword.booleanisPlus()Returns whether the SCRAM mechanism uses the PLUS channel binding.toString()Returns a String representation of the SCRAM mechanism.
-
Field Details
-
SCRAM_SHA_1
-
SCRAM_SHA_1_PLUS
-
SCRAM_SHA_256
-
SCRAM_SHA_256_PLUS
-
SCRAM_SHA_384
-
SCRAM_SHA_384_PLUS
-
SCRAM_SHA_512
-
SCRAM_SHA_512_PLUS
-
-
Method Details
-
createClient
public ScramClient createClient(String authorizationId, CallbackHandler callbackHandler, SecureRandom secureRandom, ChannelBindingCallback bindingCallback, int minimumIterationCount, int maximumIterationCount, Supplier<Provider[]> providers) throws AuthenticationMechanismException Create a SCRAM client for this mechanism.- Parameters:
authorizationId- the authorization ID (nullif none is given)callbackHandler- the callback handler (may not benull)secureRandom- an optional secure random implementation to use (may benull)bindingCallback- the optional channel binding callback result (may benull)minimumIterationCount- the minimum iteration count to allowmaximumIterationCount- the maximum iteration count to allowproviders- the security providers.- Returns:
- the SCRAM client, or
nullif the client cannot be created from this mechanism variant - Throws:
AuthenticationMechanismException- if the mechanism fails for some reason- See Also:
-
createServer
public ScramServer createServer(CallbackHandler callbackHandler, SecureRandom random, ChannelBindingCallback bindingCallback, int minimumIterationCount, int maximumIterationCount, Supplier<Provider[]> providers) throws AuthenticationMechanismException Create a SCRAM server for this mechanism.- Parameters:
callbackHandler- the callback handler (may not benull).random- an optional secure random implementation to use (may benull).bindingCallback- the optional channel binding callback result (may benull).minimumIterationCount- the minimum iteration count to allow.maximumIterationCount- the maximum iteration count to allow.providers- the security providers.- Returns:
- the SCRAM server, or
nullif the server cannot be created from this mechanism variant. - Throws:
AuthenticationMechanismException- if the mechanism fails for some reason.
-
getHashSize
public int getHashSize()Returns the size of the hash of the SCRAM mechanism.- Returns:
- the size of the hash of the SCRAM mechanism.
-
getMessageDigestName
Returns the name of the message digest algorithm.- Returns:
- the name of the message digest algorithm.
-
getHmacName
Returns the name of the HMAC algorithm.- Returns:
- the name of the HMAC algorithm.
-
isPlus
public boolean isPlus()Returns whether the SCRAM mechanism uses the PLUS channel binding.- Returns:
trueto use the PLUS channel binding,falseotherwise.
-
getPasswordAlgorithm
Returns the name of the password algorithm fromScramDigestPassword.- Returns:
- the name of the password algorithm.
-
toString
Returns a String representation of the SCRAM mechanism. Contains the Digest name, PLUS channel binding and hash size.
-