io.quarkus.vault.VaultTOTPSecretEngine Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-vault Show documentation
Show all versions of quarkus-vault Show documentation
Store your credentials securely in HashiCorp Vault
package io.quarkus.vault;
import java.util.List;
import java.util.Optional;
import io.quarkus.vault.secrets.totp.CreateKeyParameters;
import io.quarkus.vault.secrets.totp.KeyConfiguration;
import io.quarkus.vault.secrets.totp.KeyDefinition;
/**
* This service provides access to the TOTP secret engine.
*
* @see TOTP Secrets Engine
*/
public interface VaultTOTPSecretEngine {
/**
* Creates or updates a key definition.
*
* @param name of the key.
* @param createKeyParameters required to create or update a key.
* @return Barcode and/or URL of the created OTP key.
*/
Optional createKey(String name, CreateKeyParameters createKeyParameters);
/**
* Queries the key definition.
*
* @param name of the key.
* @return The key configuration.
*/
KeyConfiguration readKey(String name);
/**
* Returns a list of available keys. Only the key names are returned, not any values.
*
* @return List of available keys.
*/
List listKeys();
/**
* Deletes the key definition.
*
* @param name of the key.
*/
void deleteKey(String name);
/**
* Generates a new time-based one-time use password based on the named key.
*
* @param name of the key.
* @return The Code.
*/
String generateCode(String name);
/**
* Validates a time-based one-time use password generated from the named key.
*
* @param name of the key.
* @param code to validate.
* @return True if valid, false otherwise.
*/
boolean validateCode(String name, String code);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy