Class ScramMechanism
- java.lang.Object
-
- org.wildfly.security.mechanism.scram.ScramMechanism
-
public final class ScramMechanism extends Object
Implementation of the SCRAM authentication mechanism.- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description static ScramMechanismSCRAM_SHA_1static ScramMechanismSCRAM_SHA_1_PLUSstatic ScramMechanismSCRAM_SHA_256static ScramMechanismSCRAM_SHA_256_PLUSstatic ScramMechanismSCRAM_SHA_384static ScramMechanismSCRAM_SHA_384_PLUSstatic ScramMechanismSCRAM_SHA_512static ScramMechanismSCRAM_SHA_512_PLUS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScramClientcreateClient(String authorizationId, CallbackHandler callbackHandler, SecureRandom secureRandom, ChannelBindingCallback bindingCallback, int minimumIterationCount, int maximumIterationCount, Supplier<Provider[]> providers)Create a SCRAM client for this mechanism.ScramServercreateServer(CallbackHandler callbackHandler, SecureRandom random, ChannelBindingCallback bindingCallback, int minimumIterationCount, int maximumIterationCount, Supplier<Provider[]> providers)Create a SCRAM server for this mechanism.intgetHashSize()Returns the size of the hash of the SCRAM mechanism.StringgetHmacName()Returns the name of the HMAC algorithm.StringgetMessageDigestName()Returns the name of the message digest algorithm.StringgetPasswordAlgorithm()Returns the name of the password algorithm fromScramDigestPassword.booleanisPlus()Returns whether the SCRAM mechanism uses the PLUS channel binding.StringtoString()Returns a String representation of the SCRAM mechanism.
-
-
-
Field Detail
-
SCRAM_SHA_1
public static final ScramMechanism SCRAM_SHA_1
-
SCRAM_SHA_1_PLUS
public static final ScramMechanism SCRAM_SHA_1_PLUS
-
SCRAM_SHA_256
public static final ScramMechanism SCRAM_SHA_256
-
SCRAM_SHA_256_PLUS
public static final ScramMechanism SCRAM_SHA_256_PLUS
-
SCRAM_SHA_384
public static final ScramMechanism SCRAM_SHA_384
-
SCRAM_SHA_384_PLUS
public static final ScramMechanism SCRAM_SHA_384_PLUS
-
SCRAM_SHA_512
public static final ScramMechanism SCRAM_SHA_512
-
SCRAM_SHA_512_PLUS
public static final ScramMechanism SCRAM_SHA_512_PLUS
-
-
Method Detail
-
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:
WildFlySasl.SCRAM_MIN_ITERATION_COUNT,WildFlySasl.SCRAM_MAX_ITERATION_COUNT
-
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
public String getMessageDigestName()
Returns the name of the message digest algorithm.- Returns:
- the name of the message digest algorithm.
-
getHmacName
public String 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
public String getPasswordAlgorithm()
Returns the name of the password algorithm fromScramDigestPassword.- Returns:
- the name of the password algorithm.
-
-