Interface TotpGenerator


public interface TotpGenerator
Contract for classes to generate a Time-based One-time Password and PUC for bypassing the One-time Password for tests and PUC respectively.

The reference implementation for RFC-6238 is not working correctly with Google Authenticator. Google Authenticator is using an Base32 encoded String as secret key, while the reference implementation accepts a Hex encoded secret key. To be compatible with Google Authenticator the reference implementation is no longer used in this class. For your information: The reference implementation: https://tools.ietf.org/html/rfc6238#appendix-A

To support Base32 encoding, the algorithm from this site is used and is working with Google Authenticator: https://weblogs.java.net/blog/evanx/archive/2012/11/07/google-authenticator-thus-enabled

  • Method Summary

    Modifier and Type
    Method
    Description
    Generates a TOTP.
  • Method Details

    • generateTotp

      String generateTotp()
      Generates a TOTP.
      Returns:
      the TOTP.