Class SASLDigestMD5Mechanism

  • All Implemented Interfaces:
    java.lang.Comparable<org.jivesoftware.smack.sasl.SASLMechanism>

    public class SASLDigestMD5Mechanism
    extends org.jivesoftware.smack.sasl.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 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 class org.jivesoftware.smack.sasl.SASLMechanism
      • getAuthenticationText

        protected byte[] getAuthenticationText()
        Specified by:
        getAuthenticationText in class org.jivesoftware.smack.sasl.SASLMechanism
      • getName

        public java.lang.String getName()
        Specified by:
        getName in class org.jivesoftware.smack.sasl.SASLMechanism
      • getPriority

        public int getPriority()
        Specified by:
        getPriority in class org.jivesoftware.smack.sasl.SASLMechanism
      • newInstance

        public SASLDigestMD5Mechanism newInstance()
        Specified by:
        newInstance in class org.jivesoftware.smack.sasl.SASLMechanism
      • authzidSupported

        public boolean authzidSupported()
        Overrides:
        authzidSupported in class org.jivesoftware.smack.sasl.SASLMechanism
      • checkIfSuccessfulOrThrow

        public void checkIfSuccessfulOrThrow()
                                      throws org.jivesoftware.smack.SmackException.SmackSaslException
        Specified by:
        checkIfSuccessfulOrThrow in class org.jivesoftware.smack.sasl.SASLMechanism
        Throws:
        org.jivesoftware.smack.SmackException.SmackSaslException
      • evaluateChallenge

        protected byte[] evaluateChallenge​(byte[] challenge)
                                    throws org.jivesoftware.smack.SmackException.SmackSaslException
        Overrides:
        evaluateChallenge in class org.jivesoftware.smack.sasl.SASLMechanism
        Throws:
        org.jivesoftware.smack.SmackException.SmackSaslException
      • 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.