abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r577096 - in /incubator/abdera/java/trunk: build/ examples/src/main/java/org/apache/abdera/examples/security/ security/src/main/java/org/apache/abdera/security/util/servlet/ security/src/test/java/org/apache/abdera/test/security/
Date Tue, 18 Sep 2007 22:56:10 GMT
Author: jmsnell
Date: Tue Sep 18 15:56:10 2007
New Revision: 577096

URL: http://svn.apache.org/viewvc?rev=577096&view=rev
Log:
Remove the bouncy castle dependencies.  It will still be downloaded and used during the build
for testing, but it is no longer distributed with the zip.

Removed:
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/BCEncryptedRequestFilter.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/BCEncryptedResponseFilter.java
Modified:
    incubator/abdera/java/trunk/build/build.xml
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/security/DHEnc.java
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/security/Enc.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AESEncryptedResponseFilter.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedRequestFilter.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedResponseFilter.java
    incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/EncryptionTest.java

Modified: incubator/abdera/java/trunk/build/build.xml
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/build/build.xml?rev=577096&r1=577095&r2=577096&view=diff
==============================================================================
--- incubator/abdera/java/trunk/build/build.xml (original)
+++ incubator/abdera/java/trunk/build/build.xml Tue Sep 18 15:56:10 2007
@@ -464,6 +464,8 @@
         <exclude name="**/${xmlsecurity.jar}" unless="do.security" />
         <exclude name="**/${spring.mock.dir}" unless="do.spring" />
         <exclude name="**/${spring.web.dir}"  unless="do.spring" />
+        <exclude name="**/${bouncycastle.jar}" />
+        <exclude name="**/${bouncycastle.jar.retro}" />
       </fileset>
       <fileset dir="${docs}" includes="**/*" />
       <fileset dir="${basedir}">
@@ -495,6 +497,8 @@
         <exclude name="**/${xmlsecurity.jar}" unless="do.security" />
         <exclude name="**/${spring.mock.dir}" unless="do.spring" />
         <exclude name="**/${spring.web.dir}"  unless="do.spring" />
+        <exclude name="**/${bouncycastle.jar}" />
+        <exclude name="**/${bouncycastle.jar.retro}" />
       </fileset>
       <fileset dir="${docs}" includes="**/*" />
       <fileset dir="${basedir}">

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/security/DHEnc.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/security/DHEnc.java?rev=577096&r1=577095&r2=577096&view=diff
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/security/DHEnc.java
(original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/security/DHEnc.java
Tue Sep 18 15:56:10 2007
@@ -17,6 +17,7 @@
 */
 package org.apache.abdera.examples.security;
 
+import java.security.Provider;
 import java.security.Security;
 
 import org.apache.abdera.Abdera;
@@ -33,16 +34,32 @@
   @SuppressWarnings("unchecked")
   public static void main(String[] args) throws Exception {
     
+    Abdera abdera = new Abdera();
+    
+    try {
+      String jce = abdera.getConfiguration().getConfigurationOption(
+        "jce.provider",
+        "org.bouncycastle.jce.provider.BouncyCastleProvider");
+      Class provider = Class.forName(jce);
+      Provider p = (Provider)provider.newInstance();
+      Security.addProvider(p);
+    } catch (Exception e) {
+   // The Configured JCE Provider is not available... try to proceed anyway
+    }
+    
     // Prepare the crypto provider
     try {
-      Class.forName("org.bouncycastle.LICENSE");
-      Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
+      String jce = abdera.getConfiguration().getConfigurationOption(
+        "jce.provider",
+        "org.bouncycastle.jce.provider.BouncyCastleProvider");
+      Class provider = Class.forName(jce);
+      Provider p = (Provider)provider.newInstance();
+      Security.addProvider(p);
     } catch (Exception e) {
-      throw new RuntimeException("The Bouncy Castle JCE Provider is not available");
+      throw new RuntimeException("The Configured JCE Provider is not available");
     }
 
     // Create the entry to encrypt
-    Abdera abdera = new Abdera();
     AbderaSecurity absec = new AbderaSecurity(abdera);
     Factory factory = abdera.getFactory();
     

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/security/Enc.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/security/Enc.java?rev=577096&r1=577095&r2=577096&view=diff
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/security/Enc.java
(original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/security/Enc.java
Tue Sep 18 15:56:10 2007
@@ -17,6 +17,7 @@
 */
 package org.apache.abdera.examples.security;
 
+import java.security.Provider;
 import java.security.Security;
 
 import javax.crypto.KeyGenerator;
@@ -35,12 +36,18 @@
   @SuppressWarnings("unchecked")
   public static void main(String[] args) throws Exception {
     
+    Abdera abdera = new Abdera();
+
     // Prepare the crypto provider
     try {
-      Class.forName("org.bouncycastle.LICENSE");
-      Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
+      String jce = abdera.getConfiguration().getConfigurationOption(
+        "jce.provider",
+        "org.bouncycastle.jce.provider.BouncyCastleProvider");
+      Class provider = Class.forName(jce);
+      Provider p = (Provider)provider.newInstance();
+      Security.addProvider(p);
     } catch (Exception e) {
-      throw new RuntimeException("The Bouncy Castle JCE Provider is not available");
+// The configured JCE Provider is not available, try to proceed anyway
     }
     
     // Generate Encryption Key
@@ -51,7 +58,6 @@
     SecretKey key = keyGenerator.generateKey();
 
     // Create the entry to encrypt
-    Abdera abdera = new Abdera();
     AbderaSecurity absec = new AbderaSecurity(abdera);
     Factory factory = abdera.getFactory();
     

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AESEncryptedResponseFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AESEncryptedResponseFilter.java?rev=577096&r1=577095&r2=577096&view=diff
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AESEncryptedResponseFilter.java
(original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AESEncryptedResponseFilter.java
Tue Sep 18 15:56:10 2007
@@ -43,7 +43,7 @@
  * </pre>
  */
 public class AESEncryptedResponseFilter 
-  extends BCEncryptedResponseFilter {
+  extends AbstractEncryptedResponseFilter {
 
   public static final String PUBLICKEY = "X-PublicKey";
   

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedRequestFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedRequestFilter.java?rev=577096&r1=577095&r2=577096&view=diff
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedRequestFilter.java
(original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedRequestFilter.java
Tue Sep 18 15:56:10 2007
@@ -38,7 +38,7 @@
  * Note: this is currently untested.
  */
 public class DHEncryptedRequestFilter 
-  extends BCEncryptedRequestFilter {
+  extends AbstractEncryptedRequestFilter {
   
   @Override
   public void init(FilterConfig config) throws ServletException {

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedResponseFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedResponseFilter.java?rev=577096&r1=577095&r2=577096&view=diff
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedResponseFilter.java
(original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedResponseFilter.java
Tue Sep 18 15:56:10 2007
@@ -69,7 +69,7 @@
  * </pre>
  */
 public class DHEncryptedResponseFilter 
-  extends BCEncryptedResponseFilter {
+  extends AbstractEncryptedResponseFilter {
     
   protected boolean doEncryption(ServletRequest request, Object arg) {
     return arg != null;

Modified: incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/EncryptionTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/EncryptionTest.java?rev=577096&r1=577095&r2=577096&view=diff
==============================================================================
--- incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/EncryptionTest.java
(original)
+++ incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/EncryptionTest.java
Tue Sep 18 15:56:10 2007
@@ -17,6 +17,9 @@
 */
 package org.apache.abdera.test.security;
 
+import java.security.Provider;
+import java.security.Security;
+
 import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
 import javax.xml.namespace.QName;
@@ -39,10 +42,17 @@
   @SuppressWarnings("unchecked")
   public static void testEncryption() throws Exception {
     
+    Abdera abdera = new Abdera();
+    
     try {
-      Class.forName("org.bouncycastle.LICENSE");
+      String jce = abdera.getConfiguration().getConfigurationOption(
+        "jce.provider",
+        "org.bouncycastle.jce.provider.BouncyCastleProvider");
+      Class provider = Class.forName(jce);
+      Provider p = (Provider)provider.newInstance();
+      Security.addProvider(p);
     } catch (Exception e) {
-      EncryptionTest.fail("The Bouncy Castle JCE Provider is not available");
+      // the configured jce provider is not available, try to proceed anyway
     }
     
     // Generate Encryption Key
@@ -53,7 +63,6 @@
     SecretKey key = keyGenerator.generateKey();
 
     // Create the entry to encrypt
-    Abdera abdera = new Abdera();
     AbderaSecurity absec = new AbderaSecurity(abdera);
     Factory factory = abdera.getFactory();
     



Mime
View raw message