Package com.warrenstrange.googleauth
Class GoogleAuthenticatorKey
java.lang.Object
com.warrenstrange.googleauth.GoogleAuthenticatorKey
public final class GoogleAuthenticatorKey extends Object
This class is a JavaBean used by the GoogleAuthenticator library to represent
a secret key.
This class is immutable.
Instance of this class should only be constructed by the GoogleAuthenticator library.
- Since:
- 1.0.0
- Version:
- 1.1.4
- Author:
- Enrico M. Crisostomo
- See Also:
GoogleAuthenticator
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGoogleAuthenticatorKey.BuilderThis class is a builder to create instances of theGoogleAuthenticatorKeyclass. -
Method Summary
Modifier and Type Method Description GoogleAuthenticatorConfiggetConfig()Get the config of this key.StringgetKey()Returns the secret key in Base32 encoding.List<Integer>getScratchCodes()Get the list of scratch codes.intgetVerificationCode()Returns the verification code at time = 0 (the UNIX epoch).
-
Method Details
-
getScratchCodes
Get the list of scratch codes.- Returns:
- the list of scratch codes.
-
getConfig
Get the config of this key.- Returns:
- the config of this key.
-
getKey
Returns the secret key in Base32 encoding.- Returns:
- the secret key in Base32 encoding.
-
getVerificationCode
public int getVerificationCode()Returns the verification code at time = 0 (the UNIX epoch).- Returns:
- the verificationCode at time = 0 (the UNIX epoch).
-