smiklosovic commented on code in PR #2505:
URL: https://github.com/apache/cassandra/pull/2505#discussion_r1272550930


##########
src/java/org/apache/cassandra/config/DatabaseDescriptor.java:
##########
@@ -1217,6 +1222,35 @@ public static void applySslContext()
         }
     }
 
+    public static void applyCryptoProvider()
+    {
+        if (conf.crypto_provider == null)
+            conf.crypto_provider = new 
ParameterizedClass(DefaultCryptoProvider.class.getName(), null);
+
+        if (conf.crypto_provider.parameters == null)
+            conf.crypto_provider.parameters = new HashMap<>();
+
+        if (conf.crypto_provider.class_name == null)
+            throw new ConfigurationException("Failed to initialize crypto 
provider, class_name cannot be null");
+
+        
conf.crypto_provider.parameters.putIfAbsent(AbstractCryptoProvider.FAIL_ON_MISSING_PROVIDER_KEY,
 "false");
+
+        try
+        {
+            Class<?> cryptoProviderClass = 
Class.forName(conf.crypto_provider.class_name);
+            cryptoProvider = 
(AbstractCryptoProvider)cryptoProviderClass.getConstructor(Map.class).newInstance(conf.crypto_provider.parameters);
+            cryptoProvider.install();

Review Comment:
   I like the fact that this needs to be explicitly taken care of. I know it is 
probably overreach but installation might happen elsewhere over time, people 
can install / uninstall here and there. God knows how this is going to be used. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to