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 enum |
| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| protected String | |
| protected static final byte[] | |
| protected String | |
| protected String | |
| protected static final String | |
| protected String | |
| protected static final int | |
| protected String | |
| protected ScramShaSaslClient. | |
| protected static final byte[] | |
| protected byte[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | dispose()
Implements javax. Disposes of any system resources or security-sensitive information the SaslClient might be using. |
| public byte[] | evaluateChallenge(byte[]
The non-null challenge sent from the server.
The challenge array may have zero length. challenge)Implements javax. Evaluates the challenge data and generates a response. |
| private String | Returns: a randomly generated string formed by printable ASCII characters except comma.the length of the nonce. length)Generates a RFC 5802 safe nonce: "a sequence of random printable ASCII characters excluding ','" |
| pack-priv abstract String | Returns: a non-null string representing the IANA-registered mechanism name.Returns the real IANA-registered mechanism name of this SASL client. |
| public Object | getNegotiatedProperty(String
The non-null property name. propName)Implements javax. Retrieves the negotiated property. |
| pack-priv abstract byte[] | Returns: the hash value of the given string.the string to hash. str)The "H(str)" cryptographic hash function as described in RFC 5802, Section 2.2. |
| public boolean | hasInitialResponse()
Implements javax. Determines whether this mechanism has an optional initial response. |
| pack-priv abstract byte[] | Returns: an hash value with an output length equal to the length of H(str).the string value to use as the internal HMAC key. str, byte[] the input string to hash in the initial iteration. salt, int the number of iterations to run the algorithm. iterations)The "Hi(str, salt, i)" PBKDF2 function as described in RFC 5802, Section 2.2. |
| pack-priv abstract byte[] | Returns: the hashed value of the given params.the hash key. key, byte[] the input string. str)The "HMAC(key, str)" HMAC keyed hash algorithm as described in RFC 5802, Section 2.2. |
| public boolean | isComplete()
Implements javax. Determines whether the authentication exchange has completed. |
| private Map | Returns: aMap with the key/value pairs obtained from the server challenge.the server message (challenge) to parse. challenge)Parses a SASL challenge. |
| private String | |
| public byte[] | unwrap(byte[]
A non-null byte array containing the encoded bytes
from the server. incoming, int The starting position at offset, int incoming of the bytes to use.The number of bytes from len)incoming to use.Implements javax. Unwraps a byte array received from the server. |
| public byte[] | wrap(byte[]
A non-null byte array containing the bytes to encode. outgoing, int The starting position at offset, int outgoing of the bytes to use.The number of bytes from len)outgoing to use.Implements javax. Wraps a byte array to be sent to the server. |
| pack-priv byte[] | Returns: the same as the paraminOut, after being updated.the left operand of the XOR operation and the destination of the result. inOut, byte[] the right operand of the XOR operation. other)Combines the two byte arrays in a XOR operation, changing the contents of the first. |
| authenticationId | back to summary |
|---|---|
| protected String authenticationId | |
| authorizationId | back to summary |
|---|---|
| protected String authorizationId | |
| CLIENT_KEY | back to summary |
|---|---|
| protected static final byte[] CLIENT_KEY | |
| clientFirstMessageBare | back to summary |
|---|---|
| protected String clientFirstMessageBare | |
| cNonce | back to summary |
|---|---|
| protected String cNonce | |
| GS2_CBIND_FLAG | back to summary |
|---|---|
| protected static final String GS2_CBIND_FLAG | |
| gs2Header | back to summary |
|---|---|
| protected String gs2Header | |
| MINIMUM_ITERATIONS | back to summary |
|---|---|
| protected static final int MINIMUM_ITERATIONS | |
| password | back to summary |
|---|---|
| protected String password | |
| scramStage | back to summary |
|---|---|
| protected ScramShaSaslClient. | |
| SERVER_KEY | back to summary |
|---|---|
| protected static final byte[] SERVER_KEY | |
| serverSignature | back to summary |
|---|---|
| protected byte[] serverSignature | |
| ScramShaSaslClient | back to summary |
|---|---|
| public ScramShaSaslClient(String authorizationId, String authenticationId, String password) throws SaslException | |
| dispose | back to summary |
|---|---|
| public void dispose() throws SaslException Implements javax. Doc from javax. Disposes of any system resources or security-sensitive information the SaslClient might be using. Invoking this method invalidates the SaslClient instance. This method is idempotent.
| |
| evaluateChallenge | back to summary |
|---|---|
| public byte[] evaluateChallenge(byte[] challenge) throws SaslException Implements javax. Doc from javax. Evaluates the challenge data and generates a response. If a challenge is received from the server during the authentication process, this method is called to prepare an appropriate next response to submit to the server.
| |
| generateRandomPrintableAsciiString | back to summary |
|---|---|
| private String generateRandomPrintableAsciiString(int length) Generates a RFC 5802 safe nonce: "a sequence of random printable ASCII characters excluding ','"
| |
| getIanaMechanismName | back to summary |
|---|---|
| pack-priv abstract String getIanaMechanismName() Returns the real IANA-registered mechanism name of this SASL client. This is the same as
| |
| getNegotiatedProperty | back to summary |
|---|---|
| public Object getNegotiatedProperty(String propName) Implements javax. Doc from javax. Retrieves the negotiated property.
This method can be called only after the authentication exchange has
completed (i.e., when
The | |
| h | back to summary |
|---|---|
| pack-priv abstract byte[] h(byte[] str) The "H(str)" cryptographic hash function as described in RFC 5802, Section 2.2.
| |
| hasInitialResponse | back to summary |
|---|---|
| public boolean hasInitialResponse() Implements javax. Doc from javax. Determines whether this mechanism has an optional initial response.
If true, caller should call
| |
| hi | back to summary |
|---|---|
| pack-priv abstract byte[] hi(String str, byte[] salt, int iterations) The "Hi(str, salt, i)" PBKDF2 function as described in RFC 5802, Section 2.2.
| |
| hmac | back to summary |
|---|---|
| pack-priv abstract byte[] hmac(byte[] key, byte[] str) The "HMAC(key, str)" HMAC keyed hash algorithm as described in RFC 5802, Section 2.2.
| |
| isComplete | back to summary |
|---|---|
| public boolean isComplete() Implements javax. Doc from javax. Determines whether the authentication exchange has completed. This method may be called at any time, but typically, it will not be called until the caller has received indication from the server (in a protocol-specific manner) that the exchange has completed.
| |
| parseChallenge | back to summary |
|---|---|
| private Map Parses a SASL challenge. | |
| prepUserName | back to summary |
|---|---|
| private String prepUserName(String userName) | |
| unwrap | back to summary |
|---|---|
| public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException Implements javax. Doc from javax. Unwraps a byte array received from the server.
This method can be called only after the authentication exchange has
completed (i.e., when
| |
| wrap | back to summary |
|---|---|
| public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException Implements javax. Doc from javax. Wraps a byte array to be sent to the server.
This method can be called only after the authentication exchange has
completed (i.e., when
The result of this method will make up the contents of the SASL buffer
as defined in RFC 2222 without the leading four octet field that
represents the length.
| |
| xorInPlace | back to summary |
|---|---|
| pack-priv byte[] xorInPlace(byte[] inOut, byte[] other) Combines the two byte arrays in a XOR operation, changing the contents of the first.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final ScramShaSaslClient. | |
| private ScramShaSaslClient. | |
| public static final ScramShaSaslClient. | |
| public static final ScramShaSaslClient. | |
| public static final ScramShaSaslClient. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ScramShaSaslClient. | |
| public static ScramShaSaslClient. | |
| public static ScramShaSaslClient. |
| CLIENT_FIRST | back to summary |
|---|---|
| public static final ScramShaSaslClient. | |
| next | back to summary |
|---|---|
| private ScramShaSaslClient. | |
| SERVER_FINAL | back to summary |
|---|---|
| public static final ScramShaSaslClient. | |
| SERVER_FIRST_CLIENT_FINAL | back to summary |
|---|---|
| public static final ScramShaSaslClient. | |
| TERMINATED | back to summary |
|---|---|
| public static final ScramShaSaslClient. | |
| ScramExchangeStage | back to summary |
|---|---|
| private ScramExchangeStage(ScramShaSaslClient. | |
| getNext | back to summary |
|---|---|
| public ScramShaSaslClient. | |
| valueOf | back to summary |
|---|---|
| public static ScramShaSaslClient. | |
| values | back to summary |
|---|---|
| public static ScramShaSaslClient. | |