Class TwoFactorPasswordGeneratorImpl

    • Constructor Detail

      • TwoFactorPasswordGeneratorImpl

        public TwoFactorPasswordGeneratorImpl()
    • Method Detail

      • generatePasswords

        @NotNull
        public Set<Integer> generatePasswords​(@NotNull
                                              String secretKey,
                                              long timestampSec)
        Description copied from interface: TwoFactorPasswordGenerator
        Generates and returns all TOTP passwords that will be considered as correct, using secret key and UNIX timestamp. The multiple correct passwords are allowed to prevent time desynchroniation between client and server. For example, password from previous 30-sec. epoch can be allowed.
        Specified by:
        generatePasswords in interface TwoFactorPasswordGenerator
        Parameters:
        secretKey - secret key
        timestampSec - current UNIX timestamp in seconds
        Returns:
        set of all correct password
      • generatePassword

        public int generatePassword​(@NotNull
                                    String secretKey,
                                    long timestamp)