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

org.opensearch.plugins.CryptoPlugin Maven / Gradle / Ivy

There is a newer version: 2.18.0
Show newest version
/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 */

package org.opensearch.plugins;

import org.opensearch.common.annotation.ExperimentalApi;
import org.opensearch.common.crypto.CryptoHandler;
import org.opensearch.common.crypto.MasterKeyProvider;

/**
 * Crypto plugin to provide encryption and decryption support.
 * @opensearch.api
 */
@ExperimentalApi
public interface CryptoPlugin {

    /**
     * To create a crypto handler for handling encryption and decryption ops.
     * @param keyProvider key provider instance to provide keys used in encrypting data.
     * @param keyProviderName Name of key provider to distinguish between multiple instances created with different
     *                        configurations of same keyProviderType.
     * @param keyProviderType Unique type of key provider to distinguish between different key provider implementations.
     * @param onClose Closes key provider or other clean up operations on close.
     * @return crypto handler instance.
     */
    CryptoHandler getOrCreateCryptoHandler(
        MasterKeyProvider keyProvider,
        String keyProviderName,
        String keyProviderType,
        Runnable onClose
    );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy