Class TwoFactorPasswordGeneratorImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.auth.impl.TwoFactorPasswordGeneratorImpl
-
- All Implemented Interfaces:
TwoFactorPasswordGenerator
public class TwoFactorPasswordGeneratorImpl extends Object implements TwoFactorPasswordGenerator
-
-
Constructor Summary
Constructors Constructor Description TwoFactorPasswordGeneratorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgeneratePassword(String secretKey, long timestamp)Set<Integer>generatePasswords(String secretKey, long timestampSec)Generates and returns all TOTP passwords that will be considered as correct, using secret key and UNIX timestamp.Set<String>generateRecoveryKeys()Generates set of recovery keys with cryptographically strong generator.StringgenerateSecretKey()Generates secret key with cryptographically strong generator
-
-
-
Method Detail
-
generatePasswords
@NotNull public Set<Integer> generatePasswords(@NotNull String secretKey, long timestampSec)
Description copied from interface:TwoFactorPasswordGeneratorGenerates 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:
generatePasswordsin interfaceTwoFactorPasswordGenerator- Parameters:
secretKey- secret keytimestampSec- current UNIX timestamp in seconds- Returns:
- set of all correct password
-
generateSecretKey
@NotNull public String generateSecretKey()
Description copied from interface:TwoFactorPasswordGeneratorGenerates secret key with cryptographically strong generator- Specified by:
generateSecretKeyin interfaceTwoFactorPasswordGenerator- Returns:
- generated secret key
-
generateRecoveryKeys
@NotNull public Set<String> generateRecoveryKeys()
Description copied from interface:TwoFactorPasswordGeneratorGenerates set of recovery keys with cryptographically strong generator.- Specified by:
generateRecoveryKeysin interfaceTwoFactorPasswordGenerator- Returns:
- set with generated recovery keys
-
generatePassword
public int generatePassword(@NotNull String secretKey, long timestamp)
-
-