Package tech.mgl.utils.security.gen
Class TotpClock
java.lang.Object
tech.mgl.utils.security.gen.TotpClock
Clock input for the time-based OTPs (TOTP). The input is based on the current system time
and is adjusted by a persistently stored correction value (offset in minutes).
- Author:
- klyubin@google.com (Alex Klyubin)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGets the number of milliseconds since epoch.intGets the currently used time correction value.voidsetTimeCorrectionMinutes(int minutes) Sets the currently used time correction value.
-
Constructor Details
-
TotpClock
public TotpClock()
-
-
Method Details
-
currentTimeMillis
public long currentTimeMillis()Gets the number of milliseconds since epoch. -
getTimeCorrectionMinutes
public int getTimeCorrectionMinutes()Gets the currently used time correction value.- Returns:
- number of minutes by which this device is behind the correct time.
-
setTimeCorrectionMinutes
public void setTimeCorrectionMinutes(int minutes) Sets the currently used time correction value.- Parameters:
minutes- number of minutes by which this device is behind the correct time.
-