airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject git commit: Fixing bouncy castle version issue
Date Mon, 03 Mar 2014 20:26:21 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 47afa398b -> 119f7541c


Fixing bouncy castle version issue


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/119f7541
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/119f7541
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/119f7541

Branch: refs/heads/master
Commit: 119f7541c7dccf618fe852edcb282cdaddb51e9f
Parents: 47afa39
Author: lahiru <lahiru@apache.org>
Authored: Mon Mar 3 15:26:14 2014 -0500
Committer: lahiru <lahiru@apache.org>
Committed: Mon Mar 3 15:26:14 2014 -0500

----------------------------------------------------------------------
 modules/airavata-job-monitor/pom.xml               | 10 ++--------
 .../airavata/job/monitor/util/X509Helper.java      | 17 ++++++++---------
 2 files changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/119f7541/modules/airavata-job-monitor/pom.xml
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/pom.xml b/modules/airavata-job-monitor/pom.xml
index 4476a5d..2d1a042 100644
--- a/modules/airavata-job-monitor/pom.xml
+++ b/modules/airavata-job-monitor/pom.xml
@@ -28,12 +28,6 @@
             <groupId>org.jglobus</groupId>
             <artifactId>gss</artifactId>
             <version>${jglobus.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.bouncycastle</groupId>
-                    <artifactId>bcprov-jdk16</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.jglobus</groupId>
@@ -46,7 +40,7 @@
                 </exclusion>
             </exclusions>
         </dependency>
-        <dependency>
+        <!--dependency>
             <groupId>org.bouncycastle</groupId>
             <artifactId>bcprov-jdk15on</artifactId>
             <version>1.48</version>
@@ -55,7 +49,7 @@
             <groupId>org.bouncycastle</groupId>
             <artifactId>bcpkix-jdk15on</artifactId>
             <version>1.48</version>
-        </dependency>
+        </dependency-->
         <!-- Logging -->
         <dependency>
             <groupId>org.slf4j</groupId>

http://git-wip-us.apache.org/repos/asf/airavata/blob/119f7541/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/util/X509Helper.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/util/X509Helper.java
b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/util/X509Helper.java
index 2ed0b88..63c5172 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/util/X509Helper.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/util/X509Helper.java
@@ -20,9 +20,8 @@
 */
 package org.apache.airavata.job.monitor.util;
 
-import org.bouncycastle.openssl.PEMKeyPair;
-import org.bouncycastle.openssl.PEMParser;
-import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.openssl.PEMReader;
 
 import java.io.*;
 import java.security.*;
@@ -36,7 +35,7 @@ public class X509Helper {
 
     static {
         // parsing of RSA key fails without this
-        java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
+        java.security.Security.addProvider(new BouncyCastleProvider());
     }
 
 
@@ -82,13 +81,13 @@ public class X509Helper {
         //System.out.println(privKeyPEM);
 
         // using BouncyCastle
-        PEMParser pemParser = new PEMParser(new StringReader(privKeyPEM));
+        PEMReader pemParser = new PEMReader(new StringReader(privKeyPEM));
         Object object = pemParser.readObject();
-        //System.out.println(object);
-        JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider("BC");
-        KeyPair kp = converter.getKeyPair((PEMKeyPair)object);
-        PrivateKey privKey = kp.getPrivate();
 
+        PrivateKey privKey = null;
+        if(object instanceof KeyPair){
+            privKey = ((KeyPair)object).getPrivate();
+        }
         // PEMParser from BouncyCastle is good for reading PEM files, but I didn't want to
add that dependency
         /*
         // Base64 decode the data


Mime
View raw message