Package com.bastiaanjansen.otp
Class HOTPGenerator.Builder
java.lang.Object
com.bastiaanjansen.otp.OTPGenerator.Builder<HOTPGenerator.Builder,HOTPGenerator>
com.bastiaanjansen.otp.HOTPGenerator.Builder
- Enclosing class:
- HOTPGenerator
public static class HOTPGenerator.Builder extends OTPGenerator.Builder<HOTPGenerator.Builder,HOTPGenerator>
- Author:
- Bastiaan Jansen
- See Also:
HOTPGenerator
-
Field Summary
Fields inherited from class com.bastiaanjansen.otp.OTPGenerator.Builder
algorithm, DEFAULT_HMAC_ALGORITHM, DEFAULT_PASSWORD_LENGTH, passwordLength, secret -
Constructor Summary
Constructors Constructor Description Builder(byte[] secret) -
Method Summary
Modifier and Type Method Description HOTPGeneratorbuild()Build the generator with specified optionsstatic HOTPGeneratorfromOTPAuthURI(URI uri)Build a TOTPGenerator from an OTPAuth URIHOTPGenerator.BuildergetBuilder()static HOTPGeneratorwithDefaultValues(byte[] secret)Create a HOTPGenerator with default valuesMethods inherited from class com.bastiaanjansen.otp.OTPGenerator.Builder
getAlgorithm, getPasswordLength, getSecret, withAlgorithm, withPasswordLength
-
Constructor Details
-
Builder
public Builder(byte[] secret)
-
-
Method Details
-
getBuilder
- Specified by:
getBuilderin classOTPGenerator.Builder<HOTPGenerator.Builder,HOTPGenerator>
-
build
Build the generator with specified options- Specified by:
buildin classOTPGenerator.Builder<HOTPGenerator.Builder,HOTPGenerator>- Returns:
- HOTPGenerator
-
fromOTPAuthURI
Build a TOTPGenerator from an OTPAuth URI- Parameters:
uri- OTPAuth URI- Returns:
- HOTPGenerator
- Throws:
URISyntaxException- when URI cannot be parsed
-
withDefaultValues
Create a HOTPGenerator with default values- Parameters:
secret- used to generate hash- Returns:
- a HOTPGenerator with default values
-