for (final Map.Entry<String, PluginType<?>> entry : plugins.entrySet()) {
if (entry.getKey().equalsIgnoreCase(key)) {
found = true;
final Class<?> cl = entry.getValue().getPluginClass();
try {
final SecretKeyProvider provider = (SecretKeyProvider) cl.newInstance();
secretKey = provider.getSecretKey();
LOGGER.debug("Persisting events using SecretKeyProvider {}", cl.getName());
} catch (final Exception ex) {
LOGGER.error("Unable to create SecretKeyProvider {}, encryption will be disabled",
cl.getName());
}