Package com.warrenstrange.googleauth
Class GoogleAuthenticatorKey.Builder
java.lang.Object
com.warrenstrange.googleauth.GoogleAuthenticatorKey.Builder
- Enclosing class:
- GoogleAuthenticatorKey
public static class GoogleAuthenticatorKey.Builder extends Object
This class is a builder to create instances of the
GoogleAuthenticatorKey class.-
Constructor Summary
-
Method Summary
Modifier and Type Method Description GoogleAuthenticatorKeybuild()Creates an instance of theGoogleAuthenticatorKeyclass.GoogleAuthenticatorKey.BuildersetConfig(GoogleAuthenticatorConfig config)Sets the config of the TOTP algorithm for this key.GoogleAuthenticatorKey.BuildersetKey(String key)Sets the secret key.GoogleAuthenticatorKey.BuildersetScratchCodes(List<Integer> scratchCodes)Sets the scratch codes.GoogleAuthenticatorKey.BuildersetVerificationCode(int verificationCode)Sets the verification code.
-
Constructor Details
-
Builder
Creates an instance of the builder.- Parameters:
key- the secret key in Base32 encoding.- See Also:
GoogleAuthenticatorKey(GoogleAuthenticatorConfig, String, int, List)
-
-
Method Details
-
build
Creates an instance of theGoogleAuthenticatorKeyclass.- Returns:
- an instance of the
GoogleAuthenticatorKeyclass initialized with the properties set in this builder. - See Also:
GoogleAuthenticatorKey(GoogleAuthenticatorConfig, String, int, List)
-
setConfig
Sets the config of the TOTP algorithm for this key.- Parameters:
config- the config of the TOTP algorithm for this key.- Returns:
- the builder.
- See Also:
GoogleAuthenticatorKey(GoogleAuthenticatorConfig, String, int, List)
-
setKey
Sets the secret key.- Parameters:
key- the secret key.- Returns:
- the builder.
- See Also:
GoogleAuthenticatorKey(GoogleAuthenticatorConfig, String, int, List)
-
setVerificationCode
Sets the verification code.- Parameters:
verificationCode- the verification code.- Returns:
- the builder.
- See Also:
GoogleAuthenticatorKey(GoogleAuthenticatorConfig, String, int, List)
-
setScratchCodes
Sets the scratch codes.- Parameters:
scratchCodes- the scratch codes.- Returns:
- the builder.
- See Also:
GoogleAuthenticatorKey(GoogleAuthenticatorConfig, String, int, List)
-