Class OTPSaslClient

    • Method Detail

      • createOTPResponse

        private byte[] createOTPResponse​(String algorithm,
                                         String seed,
                                         String otp,
                                         String responseType)
                                  throws SaslException
        Create an OTP response using the extended response syntax, where: hex response = hex: word response = word: init-hex response = init-hex:<current-OTP><new-params>:<new-OTP> init-word response = init-word:<current-OTP><new-params>:<new-OTP> new-params = <algorithm identifier> <sequence integer> <seed>
        Parameters:
        algorithm - the OTP algorithm, must be either "otp-md5" or "otp-sha1"
        seed - the seed
        otp - the OTP as a string in either hex or multi-word format
        responseType - the response type, must be "hex", "word", "init-hex", or "init-word"
        Returns:
        the OTP response
        Throws:
        SaslException - if the given response type is invalid or if an error occurs while creating the response
      • createInitResponse

        private org.wildfly.common.bytes.ByteStringBuilder createInitResponse​(String newAlgorithm,
                                                                              String newSeed,
                                                                              int newSequenceNumber,
                                                                              String newOTP)
                                                                       throws SaslException
        Create an init response, excluding the response type specifier and current OTP, where: init-hex response = init-hex:<current-OTP>:<new-params>:<new-OTP> init-word response = init-word:<current-OTP>:<new-params>:<new-OTP> new-params = <algorithm identifier> <sequence integer>
        Parameters:
        newAlgorithm - the new OTP algorithm, must be either "otp-md5" or "otp-sha1"
        newSeed - the new seed
        newSequenceNumber - the new sequence number
        newOTP - the new OTP as a string in either hex or multi-word format
        Returns:
        the init response, excluding the response type specifier and current OTP
        Throws:
        SaslException - if the given OTP algorithm is invalid
      • getPasswordFromPasswordChars

        private String getPasswordFromPasswordChars​(char[] passwordChars)