Class SecureRandomOneTimeCodeGenerator

java.lang.Object
com.irurueta.authserver.authorization.application.ott.SecureRandomOneTimeCodeGenerator
All Implemented Interfaces:
OneTimeCodeGenerator

public class SecureRandomOneTimeCodeGenerator extends Object implements OneTimeCodeGenerator
Generates numeric one-time codes with a cryptographically strong random number generator. Every digit is drawn independently and uniformly, so leading zeros are kept (004217).
  • Field Details

    • RADIX

      private static final int RADIX
      Number of decimal digits.
      See Also:
    • secureRandom

      private final SecureRandom secureRandom
      Source of randomness.
  • Constructor Details

    • SecureRandomOneTimeCodeGenerator

      public SecureRandomOneTimeCodeGenerator()
  • Method Details