Package com.bastiaanjansen.otp
Class TOTPGenerator.Builder
- java.lang.Object
-
- com.bastiaanjansen.otp.TOTPGenerator.Builder
-
- Enclosing class:
- TOTPGenerator
public static final class TOTPGenerator.Builder extends Object
- Author:
- Bastiaan Jansen
- See Also:
TOTPGenerator
-
-
Constructor Summary
Constructors Constructor Description Builder(byte[] secret)Constructs a TOTPGenerator builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TOTPGeneratorbuild()Build the generator with specified optionsTOTPGenerator.BuilderwithClock(Clock clock)TOTPGenerator.BuilderwithHOTPGenerator(Consumer<HOTPGenerator.Builder> builder)TOTPGenerator.BuilderwithPeriod(Duration period)Change period
-
-
-
Method Detail
-
withHOTPGenerator
public TOTPGenerator.Builder withHOTPGenerator(Consumer<HOTPGenerator.Builder> builder)
-
withClock
public TOTPGenerator.Builder withClock(Clock clock)
-
withPeriod
public TOTPGenerator.Builder withPeriod(Duration period)
Change period- Parameters:
period- time interval between new codes- Returns:
- builder
-
build
public TOTPGenerator build()
Build the generator with specified options- Returns:
- TOTP
-
-