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

com.quorum.tessera.key.vault.KeyVaultServiceFactory Maven / Gradle / Ivy

Go to download

Tessera is a stateless Java system that is used to enable the encryption, decryption, and distribution of private transactions for Quorum.

There is a newer version: 24.4.2
Show newest version
package com.quorum.tessera.key.vault;

import com.quorum.tessera.ServiceLoaderUtil;
import com.quorum.tessera.config.Config;
import com.quorum.tessera.config.KeyVaultType;
import com.quorum.tessera.config.util.EnvironmentVariableProvider;

public interface KeyVaultServiceFactory {

    KeyVaultService create(Config config, EnvironmentVariableProvider envProvider);

    KeyVaultType getType();

    static KeyVaultServiceFactory getInstance(KeyVaultType keyVaultType) {
        return ServiceLoaderUtil.loadAll(KeyVaultServiceFactory.class)
                .filter(factory -> factory.getType() == keyVaultType)
                .findFirst()
                .orElseThrow(
                        () ->
                                new NoKeyVaultServiceFactoryException(
                                        keyVaultType
                                                + " implementation of KeyVaultServiceFactory was not found on the classpath"));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy