Class ScramClient
- java.lang.Object
-
- org.wildfly.security.mechanism.scram.ScramClient
-
public final class ScramClient extends Object
- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description private String
authorizationId
private byte[]
bindingData
private String
bindingType
private CallbackHandler
callbackHandler
private int
maximumIterationCount
private ScramMechanism
mechanism
private int
minimumIterationCount
private Supplier<Provider[]>
providers
private SecureRandom
secureRandom
-
Constructor Summary
Constructors Constructor Description ScramClient(ScramMechanism mechanism, String authorizationId, CallbackHandler callbackHandler, SecureRandom secureRandom, byte[] bindingData, String bindingType, int minimumIterationCount, int maximumIterationCount, Supplier<Provider[]> providers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAuthorizationId()
byte[]
getBindingData()
String
getBindingType()
ScramInitialClientMessage
getInitialResponse()
Create an initial response.ScramMechanism
getMechanism()
(package private) Random
getRandom()
(package private) byte[]
getRawBindingData()
ScramFinalClientMessage
handleInitialChallenge(ScramInitialClientMessage initialResponse, ScramInitialServerMessage initialChallenge)
ScramFinalServerMessage
parseFinalServerMessage(byte[] messageBytes)
ScramInitialServerMessage
parseInitialServerMessage(ScramInitialClientMessage initialResponse, byte[] bytes)
void
verifyFinalChallenge(ScramFinalClientMessage finalResponse, ScramFinalServerMessage finalChallenge)
-
-
-
Field Detail
-
mechanism
private final ScramMechanism mechanism
-
authorizationId
private final String authorizationId
-
callbackHandler
private final CallbackHandler callbackHandler
-
secureRandom
private final SecureRandom secureRandom
-
bindingData
private final byte[] bindingData
-
bindingType
private final String bindingType
-
minimumIterationCount
private final int minimumIterationCount
-
maximumIterationCount
private final int maximumIterationCount
-
-
Constructor Detail
-
ScramClient
ScramClient(ScramMechanism mechanism, String authorizationId, CallbackHandler callbackHandler, SecureRandom secureRandom, byte[] bindingData, String bindingType, int minimumIterationCount, int maximumIterationCount, Supplier<Provider[]> providers)
-
-
Method Detail
-
getRandom
Random getRandom()
-
getMechanism
public ScramMechanism getMechanism()
-
getAuthorizationId
public String getAuthorizationId()
-
getBindingType
public String getBindingType()
-
getRawBindingData
byte[] getRawBindingData()
-
getBindingData
public byte[] getBindingData()
-
getInitialResponse
public ScramInitialClientMessage getInitialResponse() throws AuthenticationMechanismException
Create an initial response. This will cause the callback handler to be initialized with an authentication name.- Returns:
- the initial response to send to the server
- Throws:
AuthenticationMechanismException
- if the client authentication failed for some reason
-
parseInitialServerMessage
public ScramInitialServerMessage parseInitialServerMessage(ScramInitialClientMessage initialResponse, byte[] bytes) throws AuthenticationMechanismException
- Throws:
AuthenticationMechanismException
-
handleInitialChallenge
public ScramFinalClientMessage handleInitialChallenge(ScramInitialClientMessage initialResponse, ScramInitialServerMessage initialChallenge) throws AuthenticationMechanismException
- Throws:
AuthenticationMechanismException
-
parseFinalServerMessage
public ScramFinalServerMessage parseFinalServerMessage(byte[] messageBytes) throws AuthenticationMechanismException
- Throws:
AuthenticationMechanismException
-
verifyFinalChallenge
public void verifyFinalChallenge(ScramFinalClientMessage finalResponse, ScramFinalServerMessage finalChallenge) throws AuthenticationMechanismException
- Throws:
AuthenticationMechanismException
-
-