Package com.mysql.cj.sasl
Class ScramShaSaslClient
java.lang.Object
com.mysql.cj.sasl.ScramShaSaslClient
- All Implemented Interfaces:
javax.security.sasl.SaslClient
- Direct Known Subclasses:
ScramSha1SaslClient,ScramSha256SaslClient
public abstract class ScramShaSaslClient
extends java.lang.Object
implements javax.security.sasl.SaslClient
A
SaslClient implementation for SCRAM-SHA mechanisms as specified in RFC 5802.
Subclasses of this class must implement the hashing algorithms for the corresponding authentication mechanism.-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classScramShaSaslClient.ScramExchangeStage -
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringauthenticationIdprotected java.lang.StringauthorizationIdprotected static byte[]CLIENT_KEYprotected java.lang.StringclientFirstMessageBareprotected java.lang.StringcNonceprotected static java.lang.StringGS2_CBIND_FLAGprotected java.lang.Stringgs2Headerprotected static intMINIMUM_ITERATIONSprotected java.lang.Stringpasswordprotected ScramShaSaslClient.ScramExchangeStagescramStageprotected static byte[]SERVER_KEYprotected byte[]serverSignature -
Constructor Summary
Constructors Constructor Description ScramShaSaslClient(java.lang.String authorizationId, java.lang.String authenticationId, java.lang.String password) -
Method Summary
Modifier and Type Method Description voiddispose()byte[]evaluateChallenge(byte[] challenge)java.lang.ObjectgetNegotiatedProperty(java.lang.String propName)booleanhasInitialResponse()booleanisComplete()byte[]unwrap(byte[] incoming, int offset, int len)byte[]wrap(byte[] outgoing, int offset, int len)
-
Field Details
-
MINIMUM_ITERATIONS
protected static final int MINIMUM_ITERATIONS- See Also:
- Constant Field Values
-
GS2_CBIND_FLAG
protected static final java.lang.String GS2_CBIND_FLAG- See Also:
- Constant Field Values
-
CLIENT_KEY
protected static final byte[] CLIENT_KEY -
SERVER_KEY
protected static final byte[] SERVER_KEY -
authorizationId
protected java.lang.String authorizationId -
authenticationId
protected java.lang.String authenticationId -
password
protected java.lang.String password -
scramStage
-
cNonce
protected java.lang.String cNonce -
gs2Header
protected java.lang.String gs2Header -
clientFirstMessageBare
protected java.lang.String clientFirstMessageBare -
serverSignature
protected byte[] serverSignature
-
-
Constructor Details
-
ScramShaSaslClient
public ScramShaSaslClient(java.lang.String authorizationId, java.lang.String authenticationId, java.lang.String password) throws javax.security.sasl.SaslException- Throws:
javax.security.sasl.SaslException
-
-
Method Details
-
hasInitialResponse
public boolean hasInitialResponse()- Specified by:
hasInitialResponsein interfacejavax.security.sasl.SaslClient
-
evaluateChallenge
public byte[] evaluateChallenge(byte[] challenge) throws javax.security.sasl.SaslException- Specified by:
evaluateChallengein interfacejavax.security.sasl.SaslClient- Throws:
javax.security.sasl.SaslException
-
isComplete
public boolean isComplete()- Specified by:
isCompletein interfacejavax.security.sasl.SaslClient
-
unwrap
public byte[] unwrap(byte[] incoming, int offset, int len) throws javax.security.sasl.SaslException- Specified by:
unwrapin interfacejavax.security.sasl.SaslClient- Throws:
javax.security.sasl.SaslException
-
wrap
public byte[] wrap(byte[] outgoing, int offset, int len) throws javax.security.sasl.SaslException- Specified by:
wrapin interfacejavax.security.sasl.SaslClient- Throws:
javax.security.sasl.SaslException
-
getNegotiatedProperty
public java.lang.Object getNegotiatedProperty(java.lang.String propName)- Specified by:
getNegotiatedPropertyin interfacejavax.security.sasl.SaslClient
-
dispose
public void dispose() throws javax.security.sasl.SaslException- Specified by:
disposein interfacejavax.security.sasl.SaslClient- Throws:
javax.security.sasl.SaslException
-