All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.vault.VaultTOTPSecretEngine Maven / Gradle / Ivy

There is a newer version: 3.0.0.Beta1
Show newest version
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