Class ScramMechanism
- java.lang.Object
-
- org.wildfly.security.mechanism.scram.ScramMechanism
-
public final class ScramMechanism extends Object
- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description private inthashSizeHash size; may be less than the output size of the MD/MACprivate StringhmacNameprivate StringmessageDigestNameprivate StringpasswordAlgorithmprivate booleanplusstatic 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_PLUSprivate StringtoString
-
Constructor Summary
Constructors Modifier Constructor Description privateScramMechanism(int hashSize, String messageDigestName, String hmacName, boolean plus, String passwordAlgorithm)
-
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)intgetHashSize()StringgetHmacName()StringgetMessageDigestName()StringgetPasswordAlgorithm()booleanisPlus()StringtoString()
-
-
-
Field Detail
-
hashSize
private final int hashSize
Hash size; may be less than the output size of the MD/MAC
-
messageDigestName
private final String messageDigestName
-
hmacName
private final String hmacName
-
plus
private final boolean plus
-
passwordAlgorithm
private final String passwordAlgorithm
-
toString
private final String toString
-
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 allow- 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
- Throws:
AuthenticationMechanismException
-
getHashSize
public int getHashSize()
-
getMessageDigestName
public String getMessageDigestName()
-
getHmacName
public String getHmacName()
-
isPlus
public boolean isPlus()
-
getPasswordAlgorithm
public String getPasswordAlgorithm()
-
-