Class TOTP.VerificationResult

java.lang.Object
io.github.pratiyush.totp.TOTP.VerificationResult
Enclosing class:
TOTP

public static final class TOTP.VerificationResult extends Object
Result of a TOTP verification with additional details.
  • Method Details

    • isValid

      public boolean isValid()
      Returns whether the code was valid.
    • getTimeOffset

      public Integer getTimeOffset()
      Returns the time offset of the matching code.

      0 means the current time window, negative values mean past windows, positive values mean future windows.

      Returns:
      time offset, or null if invalid
    • getMessage

      public String getMessage()
      Returns a human-readable message.
    • toString

      public String toString()
      Overrides:
      toString in class Object