Class SASLDigestMD5Mechanism
- java.lang.Object
-
- org.jivesoftware.smack.sasl.SASLMechanism
-
- org.jivesoftware.smack.sasl.provided.SASLDigestMD5Mechanism
-
- All Implemented Interfaces:
java.lang.Comparable<SASLMechanism>
public class SASLDigestMD5Mechanism extends SASLMechanism
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
-
Fields inherited from class org.jivesoftware.smack.sasl.SASLMechanism
authenticationId, authorizationId, connection, connectionConfiguration, CRAMMD5, DIGESTMD5, EXTERNAL, GSSAPI, host, password, PLAIN, serviceName, sslSession
-
-
Constructor Summary
Constructors Constructor Description SASLDigestMD5Mechanism()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
authenticateInternal(javax.security.auth.callback.CallbackHandler cbh)
boolean
authzidSupported()
void
checkIfSuccessfulOrThrow()
protected byte[]
evaluateChallenge(byte[] challenge)
Evaluate the SASL challenge.protected byte[]
getAuthenticationText()
Should return the initial response of the SASL mechanism.java.lang.String
getName()
Returns the common name of the SASL mechanism.int
getPriority()
Get the priority of this SASL mechanism.SASLDigestMD5Mechanism
newInstance()
static java.lang.String
quoteBackslash(java.lang.String string)
Quote the backslash in the given String.static void
setVerifyServerResponse(boolean verifyServerResponse)
-
Methods inherited from class org.jivesoftware.smack.sasl.SASLMechanism
afterFinalSaslChallenge, authenticate, authenticate, authenticateInternal, challengeReceived, compareTo, instanceForAuthentication, isAuthenticationSuccessful, isFinished, requiresPassword, saslPrep, setException, throwExceptionIfRequired, toBytes, toString
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SASLDigestMD5Mechanism
public SASLDigestMD5Mechanism()
-
-
Method Detail
-
setVerifyServerResponse
public static void setVerifyServerResponse(boolean verifyServerResponse)
-
authenticateInternal
protected void authenticateInternal(javax.security.auth.callback.CallbackHandler cbh)
- Specified by:
authenticateInternal
in classSASLMechanism
-
getAuthenticationText
protected byte[] getAuthenticationText()
Description copied from class:SASLMechanism
Should return the initial response of the SASL mechanism. The returned byte array will be send base64 encoded to the server. SASL mechanism are free to returnnull
or an empty array here.- Specified by:
getAuthenticationText
in classSASLMechanism
- Returns:
- the initial response or null
-
getName
public java.lang.String getName()
Description copied from class:SASLMechanism
Returns the common name of the SASL mechanism. E.g.: PLAIN, DIGEST-MD5 or GSSAPI.- Specified by:
getName
in classSASLMechanism
- Returns:
- the common name of the SASL mechanism.
-
getPriority
public int getPriority()
Description copied from class:SASLMechanism
Get the priority of this SASL mechanism. Lower values mean higher priority.- Specified by:
getPriority
in classSASLMechanism
- Returns:
- the priority of this SASL mechanism.
-
newInstance
public SASLDigestMD5Mechanism newInstance()
- Specified by:
newInstance
in classSASLMechanism
-
authzidSupported
public boolean authzidSupported()
- Overrides:
authzidSupported
in classSASLMechanism
-
checkIfSuccessfulOrThrow
public void checkIfSuccessfulOrThrow() throws SmackException.SmackSaslException
- Specified by:
checkIfSuccessfulOrThrow
in classSASLMechanism
- Throws:
SmackException.SmackSaslException
-
evaluateChallenge
protected byte[] evaluateChallenge(byte[] challenge) throws SmackException.SmackSaslException
Description copied from class:SASLMechanism
Evaluate the SASL challenge.- Overrides:
evaluateChallenge
in classSASLMechanism
- Parameters:
challenge
- challenge to evaluate.- Returns:
- null.
- Throws:
SmackException.SmackSaslException
- If a SASL related error occurs.
-
quoteBackslash
public static java.lang.String quoteBackslash(java.lang.String string)
Quote the backslash in the given String. Replaces all occurrences of "\" with "\\".According to RFC 2831 ยง 7.2 a quoted-string consists either of qdtext or quoted-pair. And since quoted-pair is a backslash followed by a char, every backslash in qdtext must be quoted, since it otherwise would be treated as qdtext.
- Parameters:
string
- the input string.- Returns:
- the input string where the every backslash is quoted.
-
-