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 int
hashSize
Hash size; may be less than the output size of the MD/MACprivate String
hmacName
private String
messageDigestName
private String
passwordAlgorithm
private boolean
plus
static ScramMechanism
SCRAM_SHA_1
static ScramMechanism
SCRAM_SHA_1_PLUS
static ScramMechanism
SCRAM_SHA_256
static ScramMechanism
SCRAM_SHA_256_PLUS
static ScramMechanism
SCRAM_SHA_384
static ScramMechanism
SCRAM_SHA_384_PLUS
static ScramMechanism
SCRAM_SHA_512
static ScramMechanism
SCRAM_SHA_512_PLUS
private String
toString
-
Constructor Summary
Constructors Modifier Constructor Description private
ScramMechanism(int hashSize, String messageDigestName, String hmacName, boolean plus, String passwordAlgorithm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScramClient
createClient(String authorizationId, CallbackHandler callbackHandler, SecureRandom secureRandom, ChannelBindingCallback bindingCallback, int minimumIterationCount, int maximumIterationCount, Supplier<Provider[]> providers)
Create a SCRAM client for this mechanism.ScramServer
createServer(CallbackHandler callbackHandler, SecureRandom random, ChannelBindingCallback bindingCallback, int minimumIterationCount, int maximumIterationCount, Supplier<Provider[]> providers)
int
getHashSize()
String
getHmacName()
String
getMessageDigestName()
String
getPasswordAlgorithm()
boolean
isPlus()
String
toString()
-
-
-
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 (null
if 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
null
if 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()
-
-