The DIGEST-MD5 SASL mechanism specifies two modes of authentication.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final String[] | |
| private static final int | |
| private static final String | |
| private byte[] | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final String | |
| private static final int | |
| private List | |
| private String | |
| private static final int | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | evaluateResponse(byte[] response)
Implements javax. Evaluates the response data and generates a challenge. |
| private byte[] | generateChallenge(List<String> realms, String qopStr, String cipherStr)
Generates challenge to be sent to client. |
| private byte[] | generateResponseAuth(String username, char[] passwd, byte[] cnonce, int nonceCount, byte[] authzidBytes)
Server sends a message formatted as follows: response-auth = "rspauth" "=" response-value where response-value is calculated as above, using the values sent in step two, except that if qop is "auth", then A2 is A2 = { ":", digest-uri-value } And if qop is "auth-int" or "auth-conf" then A2 is A2 = { ":", digest-uri-value, ":00000000000000000000000000000000" } Clears password afterwards. |
| public String | getAuthorizationID()
Implements javax. Reports the authorization ID in effect for the client of this session. |
| private static boolean | |
| private byte[] | Returns: response-value ('rspauth') for client to validateValidates client's response. |
| ALGORITHM_DIRECTIVE | back to summary |
|---|---|
| private static final String ALGORITHM_DIRECTIVE | |
| AUTH_PARAM | back to summary |
|---|---|
| private static final int AUTH_PARAM | |
| AUTHZID | back to summary |
|---|---|
| private static final int AUTHZID | |
| CHARSET | back to summary |
|---|---|
| private static final int CHARSET | |
| CIPHER | back to summary |
|---|---|
| private static final int CIPHER | |
| CNONCE | back to summary |
|---|---|
| private static final int CNONCE | |
| DIGEST_URI | back to summary |
|---|---|
| private static final int DIGEST_URI | |
| DIRECTIVE_KEY | back to summary |
|---|---|
| private static final String[] DIRECTIVE_KEY | |
| MAXBUF | back to summary |
|---|---|
| private static final int MAXBUF | |
| MY_CLASS_NAME | back to summary |
|---|---|
| private static final String MY_CLASS_NAME | |
| myCiphers | back to summary |
|---|---|
| private byte[] myCiphers | |
| NONCE | back to summary |
|---|---|
| private static final int NONCE | |
| NONCE_COUNT | back to summary |
|---|---|
| private static final int NONCE_COUNT | |
| NONCE_COUNT_VALUE | back to summary |
|---|---|
| private static final int NONCE_COUNT_VALUE | |
| QOP | back to summary |
|---|---|
| private static final int QOP | |
| REALM | back to summary |
|---|---|
| private static final int REALM | |
| REALM_PROPERTY | back to summary |
|---|---|
| private static final String REALM_PROPERTY | |
| RESPONSE | back to summary |
|---|---|
| private static final int RESPONSE | |
| serverRealms | back to summary |
|---|---|
| private List<String> serverRealms | |
| specifiedQops | back to summary |
|---|---|
| private String specifiedQops | |
| USERNAME | back to summary |
|---|---|
| private static final int USERNAME | |
| UTF8_DIRECTIVE | back to summary |
|---|---|
| private static final String UTF8_DIRECTIVE | |
| UTF8_PROPERTY | back to summary |
|---|---|
| private static final String UTF8_PROPERTY | |
| DigestMD5Server | back to summary |
|---|---|
| pack-priv DigestMD5Server(String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException | |
| evaluateResponse | back to summary |
|---|---|
| public byte[] evaluateResponse(byte[] response) throws SaslException Implements javax. Doc from javax. Evaluates the response data and generates a challenge.
If a response is received from the client during the authentication
process, this method is called to prepare an appropriate next
challenge to submit to the client. The challenge is null if the
authentication has succeeded and no more challenge data is to be sent
to the client. It is non-null if the authentication must be continued
by sending a challenge to the client, or if the authentication has
succeeded but challenge data needs to be processed by the client.
| |
| generateChallenge | back to summary |
|---|---|
| private byte[] generateChallenge(List<String> realms, String qopStr, String cipherStr) throws IOException Generates challenge to be sent to client. digest-challenge = 1#( realm | nonce | qop-options | stale | maxbuf | charset algorithm | cipher-opts | auth-param ) realm = "realm" "=" <"> realm-value <"> realm-value = qdstr-val nonce = "nonce" "=" <"> nonce-value <"> nonce-value = qdstr-val qop-options = "qop" "=" <"> qop-list <"> qop-list = 1#qop-value qop-value = "auth" | "auth-int" | "auth-conf" | token stale = "stale" "=" "true" maxbuf = "maxbuf" "=" maxbuf-value maxbuf-value = 1*DIGIT charset = "charset" "=" "utf-8" algorithm = "algorithm" "=" "md5-sess" cipher-opts = "cipher" "=" <"> 1#cipher-value <"> cipher-value = "3des" | "des" | "rc4-40" | "rc4" | "rc4-56" | token auth-param = token "=" ( token | quoted-string ) | |
| generateResponseAuth | back to summary |
|---|---|
| private byte[] generateResponseAuth(String username, char[] passwd, byte[] cnonce, int nonceCount, byte[] authzidBytes) throws SaslException Server sends a message formatted as follows: response-auth = "rspauth" "=" response-value where response-value is calculated as above, using the values sent in step two, except that if qop is "auth", then A2 is A2 = { ":", digest-uri-value } And if qop is "auth-int" or "auth-conf" then A2 is A2 = { ":", digest-uri-value, ":00000000000000000000000000000000" } Clears password afterwards. | |
| getAuthorizationID | back to summary |
|---|---|
| public String getAuthorizationID() Implements javax. Doc from javax. Reports the authorization ID in effect for the client of this session. This method can only be called if isComplete() returns true. | |
| uriMatches | back to summary |
|---|---|
| private static boolean uriMatches(String thisUri, String incomingUri) | |
| validateClientResponse | back to summary |
|---|---|
| private byte[] validateClientResponse(byte[][] responseVal) throws SaslException Validates client's response. digest-response = 1#( username | realm | nonce | cnonce | nonce-count | qop | digest-uri | response | maxbuf | charset | cipher | authzid | auth-param ) username = "username" "=" <"> username-value <"> username-value = qdstr-val cnonce = "cnonce" "=" <"> cnonce-value <"> cnonce-value = qdstr-val nonce-count = "nc" "=" nc-value nc-value = 8LHEX qop = "qop" "=" qop-value digest-uri = "digest-uri" "=" <"> digest-uri-value <"> digest-uri-value = serv-type "/" host [ "/" serv-name ] serv-type = 1*ALPHA host = 1*( ALPHA | DIGIT | "-" | "." ) serv-name = host response = "response" "=" response-value response-value = 32LHEX LHEX = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "a" | "b" | "c" | "d" | "e" | "f" cipher = "cipher" "=" cipher-value authzid = "authzid" "=" <"> authzid-value <"> authzid-value = qdstr-val sets: negotiatedQop negotiatedCipher negotiatedRealm negotiatedStrength digestUri (checked and set to clients to account for case diffs) sendMaxBufSize authzid (gotten from callback)
| |