ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gi...@apache.org
Subject svn commit: r1196989 - in /webservices/wss4j/branches/swssf: streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/ streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/p...
Date Thu, 03 Nov 2011 08:09:00 GMT
Author: giger
Date: Thu Nov  3 08:08:59 2011
New Revision: 1196989

URL: http://svn.apache.org/viewvc?rev=1196989&view=rev
Log:
simpliy InclusiveNamespace-list hand over. 

Modified:
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SignatureReferenceVerifyInputProcessor.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityUtils.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureInputHandler.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureReferenceVerifyInputProcessor.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11_OmitCommentsTransformer.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11_WithCommentsTransformer.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_ExclOmitCommentsTransformer.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_ExclWithCommentsTransformer.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_OmitCommentsTransformer.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_WithCommentsTransformer.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/CanonicalizerBase.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/Canonicalizer20010315ExclusiveTest.java

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SignatureReferenceVerifyInputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SignatureReferenceVerifyInputProcessor.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SignatureReferenceVerifyInputProcessor.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SignatureReferenceVerifyInputProcessor.java
Thu Nov  3 08:08:59 2011
@@ -42,10 +42,7 @@ import javax.xml.stream.events.XMLEvent;
 import java.lang.reflect.InvocationTargetException;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
 
 /**
  * @author $Author$
@@ -176,14 +173,12 @@ public class SignatureReferenceVerifyInp
                     if (canonicalizationMethodType != null) {
 
                         InclusiveNamespaces inclusiveNamespacesType = XMLSecurityUtils.getQNameType(canonicalizationMethodType.getContent(),
XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces);
-                        String inclusiveNamespaces = getInclusiveNamespaces(inclusiveNamespacesType);
-
+                        List<String> inclusiveNamespaces = inclusiveNamespacesType
!= null ? inclusiveNamespacesType.getPrefixList() : null;
                         if (WSSConstants.SOAPMESSAGE_NS10_STRTransform.equals(transformType.getAlgorithm()))
{
                             if (inclusiveNamespaces == null) {
-                                inclusiveNamespaces = "#default";
-                            } else {
-                                inclusiveNamespaces = "#default " + inclusiveNamespaces;
+                                inclusiveNamespaces = new ArrayList<String>();
                             }
+                            inclusiveNamespaces.add("#default");
                         }
                         algorithm = canonicalizationMethodType.getAlgorithm();
                         parentTransformer = WSSUtils.getTransformer(inclusiveNamespaces,
this.getBufferedDigestOutputStream(), algorithm);
@@ -197,7 +192,7 @@ public class SignatureReferenceVerifyInp
                 ((WSSecurityContext) inputProcessorChain.getSecurityContext()).registerSecurityEvent(algorithmSuiteSecurityEvent);
 
                 InclusiveNamespaces inclusiveNamespacesType = XMLSecurityUtils.getQNameType(transformType.getContent(),
XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces);
-                String inclusiveNamespaces = getInclusiveNamespaces(inclusiveNamespacesType);
+                List<String> inclusiveNamespaces = inclusiveNamespacesType != null
? inclusiveNamespacesType.getPrefixList() : null;
 
                 if (parentTransformer != null) {
                     parentTransformer = WSSUtils.getTransformer(parentTransformer, inclusiveNamespaces,
algorithm);

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityUtils.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityUtils.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityUtils.java
Thu Nov  3 08:08:59 2011
@@ -219,7 +219,7 @@ public class XMLSecurityUtils {
             Constructor<Transformer> constructor = transformerClass.getConstructor(Transformer.class);
             childTransformer = constructor.newInstance(methodParameter1);
         } catch (NoSuchMethodException e) {
-            Constructor<Transformer> constructor = transformerClass.getConstructor(String.class,
OutputStream.class);
+            Constructor<Transformer> constructor = transformerClass.getConstructor(List.class,
OutputStream.class);
             childTransformer = constructor.newInstance(methodParameter1, methodParameter2);
         }
         return childTransformer;

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureInputHandler.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureInputHandler.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureInputHandler.java
Thu Nov  3 08:08:59 2011
@@ -169,18 +169,7 @@ public abstract class AbstractSignatureI
             try {
                 final CanonicalizationMethodType canonicalizationMethodType = signatureType.getSignedInfo().getCanonicalizationMethod();
                 InclusiveNamespaces inclusiveNamespacesType = XMLSecurityUtils.getQNameType(canonicalizationMethodType.getContent(),
XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces);
-                String inclusiveNamespaces = null;
-                if (inclusiveNamespacesType != null) {
-                    List<String> prefixList = inclusiveNamespacesType.getPrefixList();
-                    StringBuilder stringBuilder = new StringBuilder();
-                    for (int i = 0; i < prefixList.size(); i++) {
-                        String s = prefixList.get(i);
-                        stringBuilder.append(s);
-                        stringBuilder.append(' ');
-                    }
-                    inclusiveNamespaces = stringBuilder.toString();
-                }
-                //todo hand over inclusive namespaces as list?
+                List<String> inclusiveNamespaces = inclusiveNamespacesType != null
? inclusiveNamespacesType.getPrefixList() : null;
                 transformer = XMLSecurityUtils.getTransformer(
                         inclusiveNamespaces,
                         this.bufferedSignerOutputStream,

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureReferenceVerifyInputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureReferenceVerifyInputProcessor.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureReferenceVerifyInputProcessor.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureReferenceVerifyInputProcessor.java
Thu Nov  3 08:08:59 2011
@@ -163,9 +163,7 @@ public abstract class AbstractSignatureR
                 TransformType transformType = transformTypeList.get(i);
 
                 InclusiveNamespaces inclusiveNamespacesType = XMLSecurityUtils.getQNameType(transformType.getContent(),
XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces);
-                String inclusiveNamespaces = getInclusiveNamespaces(inclusiveNamespacesType);
-
-                //todo hand over inclusive namespaces as list?
+                List<String> inclusiveNamespaces = inclusiveNamespacesType != null
? inclusiveNamespacesType.getPrefixList() : null;
                 String algorithm = transformType.getAlgorithm();
                 if (parentTransformer != null) {
                     parentTransformer = XMLSecurityUtils.getTransformer(parentTransformer,
inclusiveNamespaces, algorithm);
@@ -278,20 +276,5 @@ public abstract class AbstractSignatureR
         protected void setFinished(boolean finished) {
             this.finished = finished;
         }
-
-        protected String getInclusiveNamespaces(InclusiveNamespaces inclusiveNamespacesType)
{
-            if (inclusiveNamespacesType != null) {
-                StringBuilder stringBuilder = new StringBuilder();
-                List<String> prefixList = inclusiveNamespacesType.getPrefixList();
-
-                for (int j = 0; j < prefixList.size(); j++) {
-                    String s = prefixList.get(j);
-                    stringBuilder.append(s);
-                    stringBuilder.append(' ');
-                }
-                return stringBuilder.toString();
-            }
-            return null;
-        }
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureOutputProcessor.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureOutputProcessor.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureOutputProcessor.java
Thu Nov  3 08:08:59 2011
@@ -36,6 +36,7 @@ import java.lang.reflect.InvocationTarge
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
+import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -91,7 +92,9 @@ public abstract class AbstractSignatureO
 
             try {
                 if (signaturePartDef.getTransformAlgo() != null) {
-                    Transformer transformer = XMLSecurityUtils.getTransformer("#default",
this.bufferedDigestOutputStream, signaturePartDef.getC14nAlgo());
+                    List<String> inclusiveNamespaces = new ArrayList<String>();
+                    inclusiveNamespaces.add("#default");
+                    Transformer transformer = XMLSecurityUtils.getTransformer(inclusiveNamespaces,
this.bufferedDigestOutputStream, signaturePartDef.getC14nAlgo());
                     this.transformer = XMLSecurityUtils.getTransformer(transformer, null,
signaturePartDef.getTransformAlgo());
                 } else {
                     transformer = XMLSecurityUtils.getTransformer(null, this.bufferedDigestOutputStream,
signaturePartDef.getC14nAlgo());

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11.java
Thu Nov  3 08:08:59 2011
@@ -33,7 +33,7 @@ import java.util.SortedSet;
  * @version $Revision$ $Date$
  */
 public class Canonicalizer11 extends CanonicalizerBase {
-    public Canonicalizer11(String inclusiveNamespaces, boolean includeComments, OutputStream
outputStream) {
+    public Canonicalizer11(List<String> inclusiveNamespaces, boolean includeComments,
OutputStream outputStream) {
         super(inclusiveNamespaces, includeComments, outputStream);
     }
 

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11_OmitCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11_OmitCommentsTransformer.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11_OmitCommentsTransformer.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11_OmitCommentsTransformer.java
Thu Nov  3 08:08:59 2011
@@ -19,6 +19,7 @@
 package org.swssf.xmlsec.impl.transformer.canonicalizer;
 
 import java.io.OutputStream;
+import java.util.List;
 
 /**
  * @author $Author$
@@ -32,7 +33,7 @@ public class Canonicalizer11_OmitComment
      *
      * @param inclusiveNamespaces
      */
-    public Canonicalizer11_OmitCommentsTransformer(String inclusiveNamespaces, OutputStream
outputStream) {
+    public Canonicalizer11_OmitCommentsTransformer(List<String> inclusiveNamespaces,
OutputStream outputStream) {
         super(inclusiveNamespaces, false, outputStream);
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11_WithCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11_WithCommentsTransformer.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11_WithCommentsTransformer.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11_WithCommentsTransformer.java
Thu Nov  3 08:08:59 2011
@@ -19,6 +19,7 @@
 package org.swssf.xmlsec.impl.transformer.canonicalizer;
 
 import java.io.OutputStream;
+import java.util.List;
 
 /**
  * @author $Author$
@@ -32,7 +33,7 @@ public class Canonicalizer11_WithComment
      *
      * @param inclusiveNamespaces
      */
-    public Canonicalizer11_WithCommentsTransformer(String inclusiveNamespaces, OutputStream
outputStream) {
+    public Canonicalizer11_WithCommentsTransformer(List<String> inclusiveNamespaces,
OutputStream outputStream) {
         super(inclusiveNamespaces, true, outputStream);
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315.java
Thu Nov  3 08:08:59 2011
@@ -19,6 +19,7 @@
 package org.swssf.xmlsec.impl.transformer.canonicalizer;
 
 import java.io.OutputStream;
+import java.util.List;
 
 /**
  * @author $Author$
@@ -26,7 +27,7 @@ import java.io.OutputStream;
  */
 public abstract class Canonicalizer20010315 extends CanonicalizerBase {
 
-    public Canonicalizer20010315(String inclusiveNamespaces, boolean includeComments, OutputStream
outputStream) {
+    public Canonicalizer20010315(List<String> inclusiveNamespaces, boolean includeComments,
OutputStream outputStream) {
         super(inclusiveNamespaces, includeComments, outputStream);
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java
Thu Nov  3 08:08:59 2011
@@ -35,7 +35,7 @@ import java.util.SortedSet;
  */
 public abstract class Canonicalizer20010315_Excl extends CanonicalizerBase {
 
-    public Canonicalizer20010315_Excl(String inclusiveNamespaces, boolean includeComments,
OutputStream outputStream) {
+    public Canonicalizer20010315_Excl(List<String> inclusiveNamespaces, boolean includeComments,
OutputStream outputStream) {
         super(inclusiveNamespaces, includeComments, outputStream);
     }
 

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_ExclOmitCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_ExclOmitCommentsTransformer.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_ExclOmitCommentsTransformer.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_ExclOmitCommentsTransformer.java
Thu Nov  3 08:08:59 2011
@@ -19,6 +19,7 @@
 package org.swssf.xmlsec.impl.transformer.canonicalizer;
 
 import java.io.OutputStream;
+import java.util.List;
 
 /**
  * @author $Author$
@@ -26,7 +27,7 @@ import java.io.OutputStream;
  */
 public class Canonicalizer20010315_ExclOmitCommentsTransformer extends Canonicalizer20010315_Excl
{
 
-    public Canonicalizer20010315_ExclOmitCommentsTransformer(String inclusiveNamespaces,
OutputStream outputStream) {
+    public Canonicalizer20010315_ExclOmitCommentsTransformer(List<String> inclusiveNamespaces,
OutputStream outputStream) {
         super(inclusiveNamespaces, false, outputStream);
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_ExclWithCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_ExclWithCommentsTransformer.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_ExclWithCommentsTransformer.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_ExclWithCommentsTransformer.java
Thu Nov  3 08:08:59 2011
@@ -19,6 +19,7 @@
 package org.swssf.xmlsec.impl.transformer.canonicalizer;
 
 import java.io.OutputStream;
+import java.util.List;
 
 /**
  * @author $Author$
@@ -26,7 +27,7 @@ import java.io.OutputStream;
  */
 public class Canonicalizer20010315_ExclWithCommentsTransformer extends Canonicalizer20010315_Excl
{
 
-    public Canonicalizer20010315_ExclWithCommentsTransformer(String inclusiveNamespaces,
OutputStream outputStream) {
+    public Canonicalizer20010315_ExclWithCommentsTransformer(List<String> inclusiveNamespaces,
OutputStream outputStream) {
         super(inclusiveNamespaces, true, outputStream);
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_OmitCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_OmitCommentsTransformer.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_OmitCommentsTransformer.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_OmitCommentsTransformer.java
Thu Nov  3 08:08:59 2011
@@ -19,6 +19,7 @@
 package org.swssf.xmlsec.impl.transformer.canonicalizer;
 
 import java.io.OutputStream;
+import java.util.List;
 
 /**
  * @author $Author$
@@ -26,7 +27,7 @@ import java.io.OutputStream;
  */
 public class Canonicalizer20010315_OmitCommentsTransformer extends Canonicalizer20010315
{
 
-    public Canonicalizer20010315_OmitCommentsTransformer(String inclusiveNamespaces, OutputStream
outputStream) {
+    public Canonicalizer20010315_OmitCommentsTransformer(List<String> inclusiveNamespaces,
OutputStream outputStream) {
         super(inclusiveNamespaces, false, outputStream);
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_WithCommentsTransformer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_WithCommentsTransformer.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_WithCommentsTransformer.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_WithCommentsTransformer.java
Thu Nov  3 08:08:59 2011
@@ -19,6 +19,7 @@
 package org.swssf.xmlsec.impl.transformer.canonicalizer;
 
 import java.io.OutputStream;
+import java.util.List;
 
 /**
  * @author $Author$
@@ -26,7 +27,7 @@ import java.io.OutputStream;
  */
 public class Canonicalizer20010315_WithCommentsTransformer extends Canonicalizer20010315
{
 
-    public Canonicalizer20010315_WithCommentsTransformer(String inclusiveNamespaces, OutputStream
outputStream) {
+    public Canonicalizer20010315_WithCommentsTransformer(List<String> inclusiveNamespaces,
OutputStream outputStream) {
         super(inclusiveNamespaces, true, outputStream);
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/CanonicalizerBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/CanonicalizerBase.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/CanonicalizerBase.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/CanonicalizerBase.java
Thu Nov  3 08:08:59 2011
@@ -66,28 +66,26 @@ public abstract class CanonicalizerBase 
     private boolean firstCall = true;
     private SortedSet<String> inclusiveNamespaces = null;
 
-    public CanonicalizerBase(String inclusiveNamespaces, boolean includeComments, OutputStream
outputStream) {
+    public CanonicalizerBase(List<String> inclusiveNamespaces, boolean includeComments,
OutputStream outputStream) {
         this.includeComments = includeComments;
-        this.inclusiveNamespaces = prefixStr2Set(inclusiveNamespaces);
+        this.inclusiveNamespaces = prefixList2Set(inclusiveNamespaces);
         this.outputStream = outputStream;
     }
 
-    public static SortedSet<String> prefixStr2Set(String inclusiveNamespaces) {
+    public static SortedSet<String> prefixList2Set(List<String> inclusiveNamespaces)
{
 
-        if ((inclusiveNamespaces == null) || (inclusiveNamespaces.length() == 0)) {
+        if ((inclusiveNamespaces == null) || (inclusiveNamespaces.size() == 0)) {
             return null;
         }
 
         SortedSet<String> prefixes = new TreeSet<String>();
-        StringTokenizer st = new StringTokenizer(inclusiveNamespaces, " \t\r\n");
 
-        while (st.hasMoreTokens()) {
-            String prefix = st.nextToken();
-
-            if (prefix.equals("#default")) {
+        for (int i = 0; i < inclusiveNamespaces.size(); i++) {
+            String s = inclusiveNamespaces.get(i);
+            if ("#default".equals(s)) {
                 prefixes.add("");
             } else {
-                prefixes.add(prefix);
+                prefixes.add(s);
             }
         }
         return prefixes;

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/Canonicalizer20010315ExclusiveTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/Canonicalizer20010315ExclusiveTest.java?rev=1196989&r1=1196988&r2=1196989&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/Canonicalizer20010315ExclusiveTest.java
(original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/Canonicalizer20010315ExclusiveTest.java
Thu Nov  3 08:08:59 2011
@@ -33,6 +33,8 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringReader;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
@@ -212,7 +214,12 @@ public class Canonicalizer20010315Exclus
 
 */
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer("env
ns0 xsi wsu", baos);
+        List<String> inclusiveNamespaces = new ArrayList<String>();
+        inclusiveNamespaces.add("env");
+        inclusiveNamespaces.add("ns0");
+        inclusiveNamespaces.add("xsi");
+        inclusiveNamespaces.add("wsu");
+        Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer(inclusiveNamespaces,
baos);
         XMLEventReader xmlEventReader = xmlInputFactory.createXMLEventReader(
                 new StringReader(XML)
         );



Mime
View raw message