Package io.quarkus.vault.runtime
Class VaultTOTPManager
- java.lang.Object
-
- io.quarkus.vault.runtime.VaultTOTPManager
-
- All Implemented Interfaces:
VaultTOTPSecretEngine
@ApplicationScoped public class VaultTOTPManager extends Object implements VaultTOTPSecretEngine
-
-
Constructor Summary
Constructors Constructor Description VaultTOTPManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<KeyDefinition>createKey(String name, CreateKeyParameters createKeyParameters)Creates or updates a key definition.voiddeleteKey(String name)Deletes the key definition.StringgenerateCode(String name)Generates a new time-based one-time use password based on the named key.List<String>listKeys()Returns a list of available keys.KeyConfigurationreadKey(String name)Queries the key definition.booleanvalidateCode(String name, String code)Validates a time-based one-time use password generated from the named key.
-
-
-
Method Detail
-
createKey
public Optional<KeyDefinition> createKey(String name, CreateKeyParameters createKeyParameters)
Description copied from interface:VaultTOTPSecretEngineCreates or updates a key definition.- Specified by:
createKeyin interfaceVaultTOTPSecretEngine- Parameters:
name- of the key.createKeyParameters- required to create or update a key.- Returns:
- Barcode and/or URL of the created OTP key.
-
readKey
public KeyConfiguration readKey(String name)
Description copied from interface:VaultTOTPSecretEngineQueries the key definition.- Specified by:
readKeyin interfaceVaultTOTPSecretEngine- Parameters:
name- of the key.- Returns:
- The key configuration.
-
listKeys
public List<String> listKeys()
Description copied from interface:VaultTOTPSecretEngineReturns a list of available keys. Only the key names are returned, not any values.- Specified by:
listKeysin interfaceVaultTOTPSecretEngine- Returns:
- List of available keys.
-
deleteKey
public void deleteKey(String name)
Description copied from interface:VaultTOTPSecretEngineDeletes the key definition.- Specified by:
deleteKeyin interfaceVaultTOTPSecretEngine- Parameters:
name- of the key.
-
generateCode
public String generateCode(String name)
Description copied from interface:VaultTOTPSecretEngineGenerates a new time-based one-time use password based on the named key.- Specified by:
generateCodein interfaceVaultTOTPSecretEngine- Parameters:
name- of the key.- Returns:
- The Code.
-
validateCode
public boolean validateCode(String name, String code)
Description copied from interface:VaultTOTPSecretEngineValidates a time-based one-time use password generated from the named key.- Specified by:
validateCodein interfaceVaultTOTPSecretEngine- Parameters:
name- of the key.code- to validate.- Returns:
- True if valid, false otherwise.
-
-