public interface IGoogleAuthenticator
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
authorize(String secret,
int verificationCode)
Checks a verification code against a secret key using the current time.
|
boolean |
authorize(String secret,
int verificationCode,
long time)
Checks a verification code against a secret key using the specified time.
|
GoogleAuthenticatorKey |
createCredentials()
This method generates a new set of credentials including:
Secret key.
|
GoogleAuthenticatorKey |
createCredentials(String userName)
This method generates a new set of credentials invoking the
#createCredentials method with no arguments. |
int |
getTotpPassword(String secret)
This method generates the current TOTP password.
|
int |
getTotpPassword(String secret,
long time)
This method generates the TOTP password at the specified time.
|
GoogleAuthenticatorKey createCredentials()
The user must register this secret on their device.
GoogleAuthenticatorKey createCredentials(String userName)
#createCredentials method with no arguments. The generated
credentials are then saved using the configured
#ICredentialRepository service.
The user must register this secret on their device.
userName - the user name.int getTotpPassword(String secret)
secret - the encoded secret key.int getTotpPassword(String secret, long time)
secret - The encoded secret key.time - The time to use to calculate the password.boolean authorize(String secret, int verificationCode)
secret - the encoded secret key.verificationCode - the verification code.true if the validation code is valid,
false otherwise.GoogleAuthenticatorException - if a failure occurs during the
calculation of the validation code.
The only failures that should occur
are related with the cryptographic
functions provided by the JCE.authorize(String, int, long)boolean authorize(String secret, int verificationCode, long time)
windowSize property of this class.
The default value of 30 seconds recommended by RFC 6238 is used for the interval size.
secret - The encoded secret key.verificationCode - The verification code.time - The time to use to calculate the TOTP password..true if the validation code is valid, false
otherwise.GoogleAuthenticatorException - if a failure occurs during the
calculation of the validation code.
The only failures that should occur
are related with the cryptographic
functions provided by the JCE.Copyright © 2024 fossc. All rights reserved.