public static class ScramClient.Builder extends ScramClient.PreBuilder2
ScramClient.channelBinding(ChannelBinding)
and chained methods.stringPreparation
channelBinding
Modifier and Type | Method and Description |
---|---|
ScramClient.Builder |
nonceLength(int length)
Sets a non-default (
ScramClient.DEFAULT_NONCE_LENGTH ) length for the nonce generation,
if no alternate nonceSupplier is provided via nonceSupplier(NonceSupplier) . |
ScramClient.Builder |
nonceSupplier(NonceSupplier nonceSupplier)
Optional call.
|
ScramClient.Builder |
secureRandomAlgorithmProvider(String algorithm,
String provider)
Optional call.
|
ScramClient |
setup()
Gets the client, fully constructed and configured, with the provided channel binding, string preparation
properties, and the selected SCRAM mechanism based on server supported mechanisms.
|
selectClientMechanism, selectMechanismBasedOnServerAdvertised, selectMechanismBasedOnServerAdvertisedCsv
stringPreparation
public ScramClient.Builder secureRandomAlgorithmProvider(String algorithm, String provider) throws IllegalArgumentException
nonceSupplier(NonceSupplier)
).
Algorithm and provider names are those supported by the SecureRandom
class.algorithm
- The name of the algorithm to use.provider
- The name of the provider of SecureRandom. Might be null.IllegalArgumentException
- If algorithm is null, or either the algorithm or provider are not supportedpublic ScramClient.Builder nonceSupplier(NonceSupplier nonceSupplier) throws IllegalArgumentException
nonceSupplier
- A supplier of valid nonce Strings.
Please note that according to the
SCRAM RFC
only ASCII printable characters (except the comma, ',') are permitted on a nonce.
Length is not limited.IllegalArgumentException
- If nonceSupplier is nullpublic ScramClient.Builder nonceLength(int length) throws IllegalArgumentException
ScramClient.DEFAULT_NONCE_LENGTH
) length for the nonce generation,
if no alternate nonceSupplier is provided via nonceSupplier(NonceSupplier)
.length
- The length of the nonce. Must be positive and greater than 0IllegalArgumentException
- If length is less than 1public ScramClient setup()
ScramClient.DEFAULT_NONCE_LENGTH
length, unless nonceLength(int)
is called.Copyright © 2019–2024. All rights reserved.