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 int
generatePassword(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.String
generateSecretKey()
Generates secret key with cryptographically strong generator
-
-
-
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 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:TwoFactorPasswordGenerator
Generates secret key with cryptographically strong generator- Specified by:
generateSecretKey
in interfaceTwoFactorPasswordGenerator
- Returns:
- generated secret key
-
generateRecoveryKeys
@NotNull public Set<String> generateRecoveryKeys()
Description copied from interface:TwoFactorPasswordGenerator
Generates set of recovery keys with cryptographically strong generator.- Specified by:
generateRecoveryKeys
in interfaceTwoFactorPasswordGenerator
- Returns:
- set with generated recovery keys
-
generatePassword
public int generatePassword(@NotNull String secretKey, long timestamp)
-
-