Class ScramSessionFactory.Builder

    • Method Detail

      • serverAdvertisedMechanisms

        public ScramSessionFactory.Builder serverAdvertisedMechanisms​(Collection<String> serverAdvertisedMechanisms)
        Provide the list of mechanism names advertised by the server. The method will filter out mechanisms unsupported by the current implementation.
        Parameters:
        serverAdvertisedMechanisms - Names of advertised mechanisms
      • preferChannelBindingMechanism

        public ScramSessionFactory.Builder preferChannelBindingMechanism​(boolean preferChannelBinding)
        Determine whether the selection process should favor selecting a mechanism that requires channel binding over a method that has a stronger algorithm. For example, if 'SCRAM-SHA1-PLUS' and 'SCRAM-SHA256' are the available methods should it favor the `SCRAM-SHA1-PLUS` because it requires channel binding.
        Parameters:
        preferChannelBinding - Should selection prefer a channel binding mechanism
      • channelBindMethod

        public ScramSessionFactory.Builder channelBindMethod​(String channelBindMethod)
        The selected/supported channel-bind method the client plans to use. If the client does not support any channel binding methods it can pass null.
        Parameters:
        channelBindMethod - Selected/supported channel-bind method.
      • nonceLength

        public ScramSessionFactory.Builder nonceLength​(int nonceLength)
        Optional call. The length of randomly generated nonce that should be used. Only required if a specific non-default nonce length is required otherwise an implementation defined default length is used.
        Parameters:
        nonceLength - Length of randomly generated nonce.
      • secureRandomAlgorithmProvider

        public ScramSessionFactory.Builder secureRandomAlgorithmProvider​(String algorithm,
                                                                         String provider)
                                                                  throws IllegalArgumentException
        Optional call. Selects a non-default SecureRandom instance, based on the given algorithm and optionally a specific security provider. This selected SecureRandom instance will be used to generate secure random values (e.g. nonces). Algorithm and provider names are those supported by the SecureRandom class.
        Parameters:
        algorithm - The name of the algorithm to use.
        provider - The name of the provider of SecureRandom. Might be null.
        Returns:
        The same class
        Throws:
        IllegalArgumentException - If algorithm is null, or either the algorithm or provider are not supported