You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by gi...@apache.org on 2012/10/11 18:33:11 UTC
svn commit: r1397150 -
/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java
Author: giger
Date: Thu Oct 11 16:33:10 2012
New Revision: 1397150
URL: http://svn.apache.org/viewvc?rev=1397150&view=rev
Log:
Fix test (signature did not contain any reference)
Modified:
santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java?rev=1397150&r1=1397149&r2=1397150&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java Thu Oct 11 16:33:10 2012
@@ -23,6 +23,7 @@ import org.apache.xml.security.exception
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.stax.ext.*;
import org.apache.xml.security.test.stax.utils.XmlReaderToWriter;
+import org.apache.xml.security.transforms.Transforms;
import org.junit.Before;
import org.junit.BeforeClass;
import org.w3c.dom.Document;
@@ -153,6 +154,7 @@ public abstract class AbstractPerformanc
xmlSecurityProperties.setSignatureKey(key);
xmlSecurityProperties.setSignatureCerts(new X509Certificate[]{cert});
+ xmlSecurityProperties.setSignatureCanonicalizationAlgorithm("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
SecurePart securePart = new SecurePart(
new QName("http://www.example.com", "test"),
@@ -238,6 +240,11 @@ public abstract class AbstractPerformanc
Element root = document.getDocumentElement();
root.insertBefore(sig.getElement(), root.getFirstChild());
+ Transforms transforms = new Transforms(document);
+ transforms.addTransform(Transforms.TRANSFORM_ENVELOPED_SIGNATURE);
+ transforms.addTransform(Transforms.TRANSFORM_C14N_OMIT_COMMENTS);
+ sig.addDocument("", transforms, "http://www.w3.org/2000/09/xmldsig#sha1");
+
sig.sign(key);
sig.addKeyInfo(cert);