Package org.jivesoftware.smack.sasl.core
Class ScramMechanism
- java.lang.Object
-
- org.jivesoftware.smack.sasl.SASLMechanism
-
- org.jivesoftware.smack.sasl.core.ScramMechanism
-
- All Implemented Interfaces:
java.lang.Comparable<SASLMechanism>
- Direct Known Subclasses:
ScramPlusMechanism
,SCRAMSHA1Mechanism
public abstract class ScramMechanism extends SASLMechanism
-
-
Field Summary
-
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 Modifier Constructor Description protected
ScramMechanism(ScramHmac scramHmac)
-
Method Summary
All 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.protected byte[]
getChannelBindingData()
protected java.lang.String
getGs2CbindFlag()
Get the SCRAM GSS-API Channel Binding Flag value.java.lang.String
getName()
Returns the common name of the SASL mechanism.-
Methods inherited from class org.jivesoftware.smack.sasl.SASLMechanism
afterFinalSaslChallenge, authenticate, authenticate, authenticateInternal, challengeReceived, compareTo, getPriority, instanceForAuthentication, isAuthenticationSuccessful, isFinished, newInstance, requiresPassword, saslPrep, setException, throwExceptionIfRequired, toBytes, toString
-
-
-
-
Constructor Detail
-
ScramMechanism
protected ScramMechanism(ScramHmac scramHmac)
-
-
Method Detail
-
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.
-
checkIfSuccessfulOrThrow
public void checkIfSuccessfulOrThrow() throws SmackException.SmackSaslException
- Specified by:
checkIfSuccessfulOrThrow
in classSASLMechanism
- Throws:
SmackException.SmackSaslException
-
authzidSupported
public boolean authzidSupported()
- Overrides:
authzidSupported
in classSASLMechanism
-
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.
-
getGs2CbindFlag
protected java.lang.String getGs2CbindFlag()
Get the SCRAM GSS-API Channel Binding Flag value.- Returns:
- the gs2-cbind-flag value.
- See Also:
- RFC 5802 ยง 6.
-
getChannelBindingData
protected byte[] getChannelBindingData() throws SmackException.SmackSaslException
- Returns:
- the Channel Binding data.
- Throws:
SmackException.SmackSaslException
- if a SASL specific error occurred.
-
-