Class GoogleAuthenticatorConfig

java.lang.Object
com.warrenstrange.googleauth.GoogleAuthenticatorConfig

public class GoogleAuthenticatorConfig
extends Object
  • Constructor Details

  • Method Details

    • getKeyModulus

      public int getKeyModulus()
      Returns the key module.
      Returns:
      the key module.
    • getKeyRepresentation

      public KeyRepresentation getKeyRepresentation()
      Returns the key representation.
      Returns:
      the key representation.
    • getCodeDigits

      public int getCodeDigits()
      Returns the number of digits in the generated code.
      Returns:
      the number of digits in the generated code.
    • getNumberOfScratchCodes

      public int getNumberOfScratchCodes()
      Returns the number of scratch codes to generate. We are using Google's default of providing 5 scratch codes.
      Returns:
      the number of scratch codes to generate.
    • getTimeStepSizeInMillis

      public long getTimeStepSizeInMillis()
      Returns the time step size, in milliseconds, as specified by RFC 6238. The default value is 30.000.
      Returns:
      the time step size in milliseconds.
    • getWindowSize

      public int getWindowSize()
      Returns an integer value representing the number of windows of size timeStepSizeInMillis that are checked during the validation process, to account for differences between the server and the client clocks. The bigger the window, the more tolerant the library code is about clock skews.

      We are using Google's default behaviour of using a window size equal to 3. The limit on the maximum window size, present in older versions of this library, has been removed.

      Returns:
      the window size.
      See Also:
      timeStepSizeInMillis
    • getSecretBits

      public int getSecretBits()
      Returns the number of bits of the secret keys to generate. The length should always be a multiple of 8. The default value is 160 bits, and a value smaller than 128 is disallowed, as recommended by RFC 4226 ยง4.
      Returns:
      the secret size in bits.
    • getHmacHashFunction

      public HmacHashFunction getHmacHashFunction()
      Returns the cryptographic hash function used to calculate the HMAC (Hash-based Message Authentication Code). This implementation uses the SHA1 hash function by default.

      Returns:
      the HMAC hash function.