Class HOTPGenerator

java.lang.Object
org.cryptacular.generator.AbstractOTPGenerator
org.cryptacular.generator.HOTPGenerator

public class HOTPGenerator extends AbstractOTPGenerator
OTP generator component that implements the HOTP scheme described in RFC 4226.
Author:
Middleware Services
  • Constructor Details

    • HOTPGenerator

      public HOTPGenerator()
  • Method Details

    • generate

      public int generate(byte[] key, long count)
      Generates the OTP given a per-user key and invocation count.
      Parameters:
      key - Per-user key.
      count - Counter moving factor.
      Returns:
      Integer OTP.
    • getDigest

      protected org.bouncycastle.crypto.Digest getDigest()
      Specified by:
      getDigest in class AbstractOTPGenerator
      Returns:
      Digest algorithm used for HMAC operation.