public abstract class ScramShaSaslClient
extends java.lang.Object
implements javax.security.sasl.SaslClient
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.| Modifier and Type | Class and Description |
|---|---|
protected static class |
ScramShaSaslClient.ScramExchangeStage |
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
authenticationId |
protected java.lang.String |
authorizationId |
protected static byte[] |
CLIENT_KEY |
protected java.lang.String |
clientFirstMessageBare |
protected java.lang.String |
cNonce |
protected static java.lang.String |
GS2_CBIND_FLAG |
protected java.lang.String |
gs2Header |
protected static int |
MINIMUM_ITERATIONS |
protected java.lang.String |
password |
protected ScramShaSaslClient.ScramExchangeStage |
scramStage |
protected static byte[] |
SERVER_KEY |
protected byte[] |
serverSignature |
| Constructor and Description |
|---|
ScramShaSaslClient(java.lang.String authorizationId,
java.lang.String authenticationId,
java.lang.String password) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
byte[] |
evaluateChallenge(byte[] challenge) |
java.lang.Object |
getNegotiatedProperty(java.lang.String propName) |
boolean |
hasInitialResponse() |
boolean |
isComplete() |
byte[] |
unwrap(byte[] incoming,
int offset,
int len) |
byte[] |
wrap(byte[] outgoing,
int offset,
int len) |
protected static final int MINIMUM_ITERATIONS
protected static final java.lang.String GS2_CBIND_FLAG
protected static final byte[] CLIENT_KEY
protected static final byte[] SERVER_KEY
protected java.lang.String authorizationId
protected java.lang.String authenticationId
protected java.lang.String password
protected ScramShaSaslClient.ScramExchangeStage scramStage
protected java.lang.String cNonce
protected java.lang.String gs2Header
protected java.lang.String clientFirstMessageBare
protected byte[] serverSignature
public ScramShaSaslClient(java.lang.String authorizationId,
java.lang.String authenticationId,
java.lang.String password)
throws javax.security.sasl.SaslException
javax.security.sasl.SaslExceptionpublic boolean hasInitialResponse()
hasInitialResponse in interface javax.security.sasl.SaslClientpublic byte[] evaluateChallenge(byte[] challenge)
throws javax.security.sasl.SaslException
evaluateChallenge in interface javax.security.sasl.SaslClientjavax.security.sasl.SaslExceptionpublic boolean isComplete()
isComplete in interface javax.security.sasl.SaslClientpublic byte[] unwrap(byte[] incoming,
int offset,
int len)
throws javax.security.sasl.SaslException
unwrap in interface javax.security.sasl.SaslClientjavax.security.sasl.SaslExceptionpublic byte[] wrap(byte[] outgoing,
int offset,
int len)
throws javax.security.sasl.SaslException
wrap in interface javax.security.sasl.SaslClientjavax.security.sasl.SaslExceptionpublic java.lang.Object getNegotiatedProperty(java.lang.String propName)
getNegotiatedProperty in interface javax.security.sasl.SaslClientpublic void dispose()
throws javax.security.sasl.SaslException
dispose in interface javax.security.sasl.SaslClientjavax.security.sasl.SaslException