pirk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From char...@apache.org
Subject incubator-pirk git commit: PIRK-8 - SecureRandom Alg and Provider Options to QuerierDriverCLI - closes apache/incubator-pirk#12
Date Tue, 19 Jul 2016 20:18:10 GMT
Repository: incubator-pirk
Updated Branches:
  refs/heads/master 219c41bc1 -> 9a22f39dd


PIRK-8 - SecureRandom Alg and Provider Options to QuerierDriverCLI - closes apache/incubator-pirk#12


Project: http://git-wip-us.apache.org/repos/asf/incubator-pirk/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-pirk/commit/9a22f39d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-pirk/tree/9a22f39d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-pirk/diff/9a22f39d

Branch: refs/heads/master
Commit: 9a22f39ddbcacee0bb614f95e657a197b9d69777
Parents: 219c41b
Author: ellisonanne <eawilliams@apache.org>
Authored: Tue Jul 19 16:17:09 2016 -0400
Committer: charris <charris@apache.org>
Committed: Tue Jul 19 16:17:09 2016 -0400

----------------------------------------------------------------------
 .../querier/wideskies/QuerierDriverCLI.java     | 39 +++++++++++++++++++-
 1 file changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/9a22f39d/src/main/java/org/apache/pirk/querier/wideskies/QuerierDriverCLI.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/pirk/querier/wideskies/QuerierDriverCLI.java b/src/main/java/org/apache/pirk/querier/wideskies/QuerierDriverCLI.java
index 3783c5b..1f48ae5 100644
--- a/src/main/java/org/apache/pirk/querier/wideskies/QuerierDriverCLI.java
+++ b/src/main/java/org/apache/pirk/querier/wideskies/QuerierDriverCLI.java
@@ -25,6 +25,7 @@ import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
 import org.apache.log4j.Logger;
+import org.apache.pirk.querier.wideskies.QuerierConst;
 import org.apache.pirk.schema.data.LoadDataSchemas;
 import org.apache.pirk.schema.query.LoadQuerySchemas;
 import org.apache.pirk.utils.LogUtils;
@@ -60,7 +61,9 @@ public class QuerierDriverCLI
   public static String EMBEDSELECTOR = "embedSelector";
   public static String USEMEMLOOKUPTABLE = "memLookupTable";
   public static String USEHDFSLOOKUPTABLE = "useHDFSLookupTable";
-
+  public static String SR_ALGORITHM = "secureRandomAlg";
+  public static String SR_PROVIDER = "secureRandomProvider"; 
+  
   // Decryption variables
   public static String QUERIERFILE = "querierFile";
 
@@ -266,6 +269,24 @@ public class QuerierDriverCLI
       {
         SystemConfiguration.setProperty(USEHDFSLOOKUPTABLE, getOptionValue(USEHDFSLOOKUPTABLE));
       }
+      
+      if (!hasOption(SR_ALGORITHM))
+      {
+        SystemConfiguration.setProperty("pallier.secureRandom.algorithm", "NativePRNG");
+      }
+      else
+      {
+        SystemConfiguration.setProperty("pallier.secureRandom.algorithm", getOptionValue(SR_ALGORITHM));
+      }
+      
+      if (!hasOption(SR_PROVIDER))
+      {
+        SystemConfiguration.setProperty("pallier.secureRandom.provider", "SUN");
+      }
+      else
+      {
+        SystemConfiguration.setProperty("pallier.secureRandom.provider", getOptionValue(SR_PROVIDER));
+      }
     }
 
     // Parse decryption args
@@ -448,7 +469,21 @@ public class QuerierDriverCLI
     optionQUERIERFILE.setArgName(QUERIERFILE);
     optionQUERIERFILE.setType(String.class);
     options.addOption(optionQUERIERFILE);
-
+    
+    //SR_ALGORITHM
+    Option optionSR_ALGORITHM = new Option("srAlg", SR_ALGORITHM, true, "optional - specify
the SecureRandom algorithm, defaults to NativePRNG");
+    optionSR_ALGORITHM.setRequired(false);
+    optionSR_ALGORITHM.setArgName(SR_ALGORITHM);
+    optionSR_ALGORITHM.setType(String.class);
+    options.addOption(optionSR_ALGORITHM);
+    
+    //SR_PROVIDERS
+    Option optionSR_PROVIDER = new Option("srProvider", SR_PROVIDER, true, "optional - specify
the SecureRandom provider, defaults to SUN");
+    optionSR_PROVIDER.setRequired(false);
+    optionSR_PROVIDER.setArgName(SR_PROVIDER);
+    optionSR_PROVIDER.setType(String.class);
+    options.addOption(optionSR_PROVIDER);
+    
     return options;
   }
 


Mime
View raw message