You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by mu...@apache.org on 2007/09/21 23:14:12 UTC

svn commit: r578277 - in /xml/security/branches/stax_jsr105/src/com/r_bg/stax: ./ c14n/ transforms/

Author: mullan
Date: Fri Sep 21 14:14:07 2007
New Revision: 578277

URL: http://svn.apache.org/viewvc?rev=578277&view=rev
Log:
Add Apache copyrights.

Removed:
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxSignatureVerificator.java
Modified:
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/C14nWorker.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/DigestResultListener.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxProvider.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxSignatureValidator.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxValidateContext.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxWatcher.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxWorker.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxXMLSignatureFactory.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/XMLSignatureWorker.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/AttributeComparator.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/AttributeHandleExclusive.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14Unknown.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14n.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14nAttributeHandler.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14nInclusive.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/NsComparator.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/StaxC14nHelper.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxInclusiveC14N.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxInclusiveC14NWithComments.java
    xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxTransform.java

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/C14nWorker.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/C14nWorker.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/C14nWorker.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/C14nWorker.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License. 
+ *
+ */             
 package com.r_bg.stax;
 
 import java.io.OutputStream;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/DigestResultListener.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/DigestResultListener.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/DigestResultListener.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/DigestResultListener.java Fri Sep 21 14:14:07 2007
@@ -1,7 +1,23 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License. 
+ *
+ */             
 package com.r_bg.stax;
 
 interface DigestResultListener {
 
 	public abstract void setResult(byte[] result);
 
-}
\ No newline at end of file
+}

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxProvider.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxProvider.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxProvider.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxProvider.java Fri Sep 21 14:14:07 2007
@@ -54,6 +54,16 @@
 	map.put((String) "TransformService." + 
 		CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS +
 		" MechanismType", "Stax");
+        map.put((String) "TransformService."+ CanonicalizationMethod.EXCLUSIVE, 
+	        "com.r_bg.stax.transforms.StaxExclusiveC14N");
+	map.put((String) "TransformService."+ CanonicalizationMethod.EXCLUSIVE +
+		" MechanismType", "Stax");
+        map.put((String) "TransformService." + 
+		CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS, 
+	        "com.r_bg.stax.transforms.StaxExclusiveC14NWithComments");
+	map.put((String) "TransformService." + 
+		CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS +
+		" MechanismType", "Stax");
 	
        	AccessController.doPrivileged(new java.security.PrivilegedAction() {
 	    public Object run() {

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxSignatureValidator.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxSignatureValidator.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxSignatureValidator.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxSignatureValidator.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License. 
+ *
+ */             
 package com.r_bg.stax;
 
 import java.io.OutputStream;
@@ -8,8 +24,6 @@
 import javax.xml.crypto.dsig.TransformException;
 import javax.xml.stream.StreamFilter;
 import javax.xml.stream.XMLStreamReader;
-
-import com.r_bg.stax.transforms.StaxTransform;
 
 class IdWatcher implements StaxWatcher {
 	String id;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxValidateContext.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxValidateContext.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxValidateContext.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxValidateContext.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License. 
+ *
+ */             
 package com.r_bg.stax;
 
 import java.security.Key;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxWatcher.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxWatcher.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxWatcher.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxWatcher.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License. 
+ *
+ */             
 package com.r_bg.stax;
 
 import javax.xml.stream.XMLStreamReader;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxWorker.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxWorker.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxWorker.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxWorker.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License. 
+ *
+ */             
 package com.r_bg.stax;
 
 import javax.xml.stream.XMLStreamReader;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxXMLSignatureFactory.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxXMLSignatureFactory.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxXMLSignatureFactory.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/StaxXMLSignatureFactory.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License. 
+ *
+ */             
+
 package com.r_bg.stax;
 
 import java.security.AccessController;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/XMLSignatureWorker.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/XMLSignatureWorker.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/XMLSignatureWorker.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/XMLSignatureWorker.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License. 
+ *
+ */             
+
 package com.r_bg.stax;
 
 import java.io.ByteArrayInputStream;
@@ -38,6 +55,7 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
+import com.r_bg.stax.c14n.StaxCanonicalizationMethod;
 import com.r_bg.stax.transforms.StaxTransform;
 
 import org.apache.xml.security.algorithms.JCEMapper;
@@ -123,7 +141,12 @@
 		    return new IdWatcher(uri.substring(1), this, transforms, os);
 //		    return new IdWatcher(uri.substring(1),this,transforms,System.out);
 		} else {
-		    URIDereferencer ud = StaxURIDereferencer.INSTANCE;
+        	    // use user-specified URIDereferencer if specified; 
+		    // otherwise use deflt
+		    URIDereferencer ud = context.getURIDereferencer();
+		    if (ud == null) {
+            	        ud = StaxURIDereferencer.INSTANCE;
+		    } 
 		    try {
 		        Data data = ud.dereference(this, context);
                        	for (Transform t : transforms) {
@@ -222,7 +245,7 @@
 //	C14nWorker c14n=new C14nWorker(this, System.out, false);
 	List<ReferenceWorker> references=new ArrayList<ReferenceWorker>();
 	StaxSignatureMethod signatureMethod;
-	String c14nMethod;
+	StaxCanonicalizationMethod c14nMethod;
 	private String id;
 	private XMLCryptoContext context;
 	SignedInfoWorker(XMLCryptoContext context) {
@@ -245,8 +268,8 @@
 				    me.printStackTrace();
 				}
 			} else if (name.equals("CanonicalizationMethod")) {
-				//TODO: Change c14n.
-				c14nMethod=reader.getAttributeValue(null,"Algorithm");
+				c14nMethod = new StaxCanonicalizationMethod();
+				return c14nMethod;
 			}
 		}
 		if (initial) {
@@ -263,23 +286,7 @@
 	}
 
 	public CanonicalizationMethod getCanonicalizationMethod() {
-		return new CanonicalizationMethod() {
-			public AlgorithmParameterSpec getParameterSpec() {
-				return null;
-			}
-			public String getAlgorithm() {
-				return c14nMethod;
-			}
-			public boolean isFeatureSupported(String feature) {
-				return false;
-			}
-			public Data transform(Data data, XMLCryptoContext context) throws TransformException {
-				throw new UnsupportedOperationException();
-			}
-			public Data transform(Data data, XMLCryptoContext context, OutputStream os) throws TransformException {
-				throw new UnsupportedOperationException();
-			}
-		};
+		return c14nMethod;
 	}
 
 	public SignatureMethod getSignatureMethod() {

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/AttributeComparator.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/AttributeComparator.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/AttributeComparator.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/AttributeComparator.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package com.r_bg.stax.c14n;
 
 import java.util.Comparator;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/AttributeHandleExclusive.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/AttributeHandleExclusive.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/AttributeHandleExclusive.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/AttributeHandleExclusive.java Fri Sep 21 14:14:07 2007
@@ -1,9 +1,27 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package com.r_bg.stax.c14n;
 
 import java.io.IOException;
 import java.io.OutputStream;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
@@ -14,6 +32,14 @@
 public class AttributeHandleExclusive implements C14nAttributeHandler {
 	static final byte[] EQ={'=','"'};
 	static final byte[] XMLNS={' ','x','m','l','n','s'};
+	private List<String> inclusivePrefixes = Collections.emptyList();
+
+	public AttributeHandleExclusive() {}
+
+	public AttributeHandleExclusive(List<String> inclusivePrefixes) {
+	    this.inclusivePrefixes = inclusivePrefixes;
+	}
+
 	public void handleAttributes(XMLStreamReader in,StaxC14nHelper nsD,OutputStream os) throws IOException{
 		SortedSet args=new TreeSet(new AttributeCompartor(in));
 		SortedSet nss=new TreeSet();
@@ -23,7 +49,7 @@
 		for (int i=0;i<length;i++) {
 			args.add(new Integer(i));
 			String prefix=in.getAttributePrefix(i);
-			if (!prefix.isEmpty())
+			if (!prefix.isEmpty() || inclusivePrefixes.contains("#default"))
 				prefixes.add(prefix);
 		}		
 		prefixes.add(in.getPrefix()==null? "" : in.getPrefix());
@@ -37,6 +63,16 @@
 			if (!nsD.hasBeenRender(prefix,nsDef))
 				nss.add(prefix);
 		}
+		it = inclusivePrefixes.iterator();
+		while (it.hasNext()) {
+			String prefix=(String)it.next();
+			String nsDef=nc.getNamespaceURI(prefix);
+			if (nsDef==null)
+				nsDef="";
+			if (!nsD.hasBeenRender(prefix,nsDef))
+				nss.add(prefix);
+		}
+		    
 		it=nss.iterator();
 		while (it.hasNext()) {			
 			String realPrefix=(String) it.next();

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14Unknown.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14Unknown.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14Unknown.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14Unknown.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package com.r_bg.stax.c14n;
 
 import javax.xml.stream.EventFilter;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14n.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14n.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14n.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14n.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package com.r_bg.stax.c14n;
 
 import java.io.ByteArrayOutputStream;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14nAttributeHandler.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14nAttributeHandler.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14nAttributeHandler.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14nAttributeHandler.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package com.r_bg.stax.c14n;
 
 import java.io.IOException;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14nInclusive.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14nInclusive.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14nInclusive.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/C14nInclusive.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package com.r_bg.stax.c14n;
 
 import java.io.IOException;

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/NsComparator.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/NsComparator.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/NsComparator.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/NsComparator.java Fri Sep 21 14:14:07 2007
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2007 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package com.r_bg.stax.c14n;
 
 import java.util.Comparator;
@@ -16,4 +32,4 @@
 		String uri2=in.getNamespacePrefix(second);
 		return uri1.compareTo(uri2);						
 	}	
-}
\ No newline at end of file
+}

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/StaxC14nHelper.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/StaxC14nHelper.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/StaxC14nHelper.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/c14n/StaxC14nHelper.java Fri Sep 21 14:14:07 2007
@@ -1,6 +1,6 @@
 package com.r_bg.stax.c14n;
 /*
- * Copyright  1999-2004 The Apache Software Foundation.
+ * Copyright  2004-2007 The Apache Software Foundation.
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -52,4 +52,4 @@
 		return false;
 	}
 	
-}
\ No newline at end of file
+}

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxInclusiveC14N.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxInclusiveC14N.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxInclusiveC14N.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxInclusiveC14N.java Fri Sep 21 14:14:07 2007
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 The Apache Software Foundation.
+ * Copyright 2007 The Apache Software Foundation.
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxInclusiveC14NWithComments.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxInclusiveC14NWithComments.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxInclusiveC14NWithComments.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxInclusiveC14NWithComments.java Fri Sep 21 14:14:07 2007
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 The Apache Software Foundation.
+ * Copyright 2007 The Apache Software Foundation.
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.

Modified: xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxTransform.java
URL: http://svn.apache.org/viewvc/xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxTransform.java?rev=578277&r1=578276&r2=578277&view=diff
==============================================================================
--- xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxTransform.java (original)
+++ xml/security/branches/stax_jsr105/src/com/r_bg/stax/transforms/StaxTransform.java Fri Sep 21 14:14:07 2007
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 The Apache Software Foundation.
+ * Copyright 2007 The Apache Software Foundation.
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
 package com.r_bg.stax.transforms;
 
 import java.io.OutputStream;
+import java.security.InvalidAlgorithmParameterException;
 import java.security.NoSuchAlgorithmException;
 import java.security.spec.AlgorithmParameterSpec;
 import javax.xml.crypto.*;
@@ -26,6 +27,7 @@
 import javax.xml.stream.XMLStreamWriter;
 
 import com.r_bg.stax.StaxProvider;
+import com.r_bg.stax.StaxStructure;
 import com.r_bg.stax.StaxWatcher;
 import com.r_bg.stax.StaxWorker;
 
@@ -37,6 +39,7 @@
 public class StaxTransform implements Transform, StaxWorker {
 
     private TransformService spi;
+    private boolean transformRead = false;
 
     public StaxWorker read(XMLStreamReader reader) {
         switch (reader.getEventType()) {
@@ -50,8 +53,22 @@
 	            } catch (NoSuchAlgorithmException e) {
 	                e.printStackTrace();
                     }
-                }
+                } else {
+		    if (!transformRead) {
+		        try {
+		            spi.init(new StaxStructure(reader), null);
+		        } catch (InvalidAlgorithmParameterException e) {
+			    e.printStackTrace();
+		        }
+		    }
+		}
                 break;
+            case XMLStreamReader.END_ELEMENT:
+                if (XMLSignature.XMLNS.equals(reader.getNamespaceURI()) &&
+		    reader.getLocalName().equals("Transform")) {
+			transformRead = true;
+		}
+		break;
         }
         return null;
     }