public class ScramSha1SaslClient extends ScramShaSaslClient
SaslClient implementation for SCRAM-SHA-1, as specified in RFC 5802.
The IANA-registered mechanism was renamed to "MYSQLCJ-SCRAM-SHA-1" in order to avoid future conflicts with an officially supported implementation.
When there is a Java-supported implementation for SCRAM-SHA-1, it will have to be thoroughly tested with Connector/J and if that works, this code can be
obsoleted.ScramShaSaslClient.ScramExchangeStage| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
HMAC_SHA1_ALGORITHM |
static java.lang.String |
IANA_MECHANISM_NAME |
static java.lang.String |
MECHANISM_NAME |
private static java.lang.String |
PBKCF2_HMAC_SHA1_ALGORITHM |
private static java.lang.String |
SHA1_ALGORITHM |
private static int |
SHA1_HASH_LENGTH |
authenticationId, authorizationId, CLIENT_KEY, clientFirstMessageBare, cNonce, GS2_CBIND_FLAG, gs2Header, MINIMUM_ITERATIONS, password, scramStage, SERVER_KEY, serverSignature| Constructor and Description |
|---|
ScramSha1SaslClient(java.lang.String authorizationId,
java.lang.String authenticationId,
java.lang.String password) |
| Modifier and Type | Method and Description |
|---|---|
(package private) java.lang.String |
getIanaMechanismName()
Returns the real IANA-registered mechanism name of this SASL client.
|
java.lang.String |
getMechanismName() |
(package private) byte[] |
h(byte[] str)
The "H(str)" cryptographic hash function as described in RFC 5802, Section 2.2.
|
(package private) byte[] |
hi(java.lang.String str,
byte[] salt,
int iterations)
The "Hi(str, salt, i)" PBKDF2 function as described in RFC 5802, Section 2.2.
|
(package private) byte[] |
hmac(byte[] key,
byte[] str)
The "HMAC(key, str)" HMAC keyed hash algorithm as described in RFC 5802, Section 2.2.
|
dispose, evaluateChallenge, getNegotiatedProperty, hasInitialResponse, isComplete, unwrap, wrap, xorInPlacepublic static final java.lang.String IANA_MECHANISM_NAME
public static final java.lang.String MECHANISM_NAME
private static final java.lang.String SHA1_ALGORITHM
private static final java.lang.String HMAC_SHA1_ALGORITHM
private static final java.lang.String PBKCF2_HMAC_SHA1_ALGORITHM
private static final int SHA1_HASH_LENGTH
public ScramSha1SaslClient(java.lang.String authorizationId,
java.lang.String authenticationId,
java.lang.String password)
throws javax.security.sasl.SaslException
javax.security.sasl.SaslExceptionjava.lang.String getIanaMechanismName()
ScramShaSaslClientSaslClient.getMechanismName() except that subclasses may
use custom mechanism names to avoid future name clashes.getIanaMechanismName in class ScramShaSaslClientpublic java.lang.String getMechanismName()
byte[] h(byte[] str)
h in class ScramShaSaslClientstr - the string to hash.byte[] hmac(byte[] key,
byte[] str)
hmac in class ScramShaSaslClientkey - the hash key.str - the input string.byte[] hi(java.lang.String str,
byte[] salt,
int iterations)
hi in class ScramShaSaslClientstr - the string value to use as the internal HMAC key.salt - the input string to hash in the initial iteration.iterations - the number of iterations to run the algorithm.