You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by co...@apache.org on 2015/12/15 18:13:22 UTC

svn commit: r1720201 [23/24] - in /santuario/xml-security-java/trunk: samples/javax/xml/crypto/dsig/samples/ samples/org/apache/xml/security/samples/ samples/org/apache/xml/security/samples/algorithms/ samples/org/apache/xml/security/samples/canonicali...

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationTest.java Tue Dec 15 17:13:17 2015
@@ -64,36 +64,36 @@ public class SignatureCreationTest exten
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
-            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(), 
+            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
             "default".toCharArray()
         );
         Key key = keyStore.getKey("transmitter", "default".toCharArray());
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
 
         //first child element must be the dsig:Signature @see SANTUARIO-324:
@@ -106,7 +106,7 @@ public class SignatureCreationTest exten
             }
             childNode = childNode.getNextSibling();
         }
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
@@ -214,7 +214,7 @@ public class SignatureCreationTest exten
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSignRootElementInRequest() throws Exception {
         // Set up the Configuration
@@ -222,19 +222,19 @@ public class SignatureCreationTest exten
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
-            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(), 
+            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
             "default".toCharArray()
         );
         Key key = keyStore.getKey("transmitter", "default".toCharArray());
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(null,
                               SecurePart.Modifier.Content,
                               new String[]{
@@ -244,22 +244,22 @@ public class SignatureCreationTest exten
                               "http://www.w3.org/2000/09/xmldsig#sha1");
         securePart.setSecureEntireRequest(true);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        
-        Document document = 
+
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
 
         //first child element must be the dsig:Signature @see SANTUARIO-324:
@@ -272,7 +272,7 @@ public class SignatureCreationTest exten
             }
             childNode = childNode.getNextSibling();
         }
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
@@ -363,45 +363,45 @@ public class SignatureCreationTest exten
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
-            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(), 
+            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
             "default".toCharArray()
         );
         Key key = keyStore.getKey("transmitter", "default".toCharArray());
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        securePart = 
+        securePart =
                 new SecurePart(new QName("urn:example:po", "ShippingAddress"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testMultipleSignatures() throws Exception {
         // Set up the Configuration
@@ -409,49 +409,49 @@ public class SignatureCreationTest exten
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
-            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(), 
+            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
             "default".toCharArray()
         );
         Key key = keyStore.getKey("transmitter", "default".toCharArray());
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // Now do second signature
         sourceDocument = new ByteArrayInputStream(baos.toByteArray());
         outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         baos = new ByteArrayOutputStream();
         xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
+
         xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         XPathFactory xpf = XPathFactory.newInstance();
         XPath xpath = xpf.newXPath();
@@ -478,7 +478,7 @@ public class SignatureCreationTest exten
             Assert.assertTrue(signature.checkSignatureValue(cert));
         }
     }
-    
+
     @Test
     public void testHMACSignatureCreation() throws Exception {
         // Set up the Configuration
@@ -486,38 +486,38 @@ public class SignatureCreationTest exten
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         byte[] hmacKey = "secret".getBytes("ASCII");
         SecretKey key = new SecretKeySpec(hmacKey, "http://www.w3.org/2000/09/xmldsig#hmac-sha1");
         properties.setSignatureKey(key);
-        
+
         properties.setSignatureAlgorithm("http://www.w3.org/2000/09/xmldsig#hmac-sha1");
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                 new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, key, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testStrongSignatureCreation() throws Exception {
         // Set up the Configuration
@@ -536,54 +536,54 @@ public class SignatureCreationTest exten
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         properties.setSignatureAlgorithm("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256");
         properties.setSignatureDigestAlgorithm("http://www.w3.org/2001/04/xmlenc#sha256");
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testECDSASignatureCreation() throws Exception {
-        
+
         if (Security.getProvider("BC") == null) {
             return;
         }
-        
+
         //
         // This test fails with the IBM JDK
         //
         if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
             return;
         }
-        
+
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
@@ -595,53 +595,53 @@ public class SignatureCreationTest exten
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("ECDSA");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         properties.setSignatureAlgorithm("http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1");
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testStrongECDSASignatureCreation() throws Exception {
-        
+
         if (Security.getProvider("BC") == null) {
             return;
         }
-        
+
         //
         // This test fails with the IBM JDK
         //
         if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
             return;
         }
-        
+
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
                 this.getClass().getClassLoader().getResource(
@@ -656,27 +656,27 @@ public class SignatureCreationTest exten
         properties.setSignatureAlgorithm("http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256");
         properties.setSignatureCanonicalizationAlgorithm("http://www.w3.org/2001/10/xml-exc-c14n#");
         properties.setSignatureDigestAlgorithm("http://www.w3.org/2001/04/xmlenc#sha256");
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
@@ -688,7 +688,7 @@ public class SignatureCreationTest exten
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
@@ -701,27 +701,27 @@ public class SignatureCreationTest exten
         properties.setSignatureCerts(new X509Certificate[]{cert});
 
         properties.setSignatureCanonicalizationAlgorithm("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
@@ -857,7 +857,7 @@ public class SignatureCreationTest exten
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testC14n11Method() throws Exception {
         // Set up the Configuration
@@ -865,7 +865,7 @@ public class SignatureCreationTest exten
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
@@ -878,27 +878,27 @@ public class SignatureCreationTest exten
         properties.setSignatureCerts(new X509Certificate[]{cert});
 
         properties.setSignatureCanonicalizationAlgorithm("http://www.w3.org/2006/12/xml-c14n11");
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
@@ -962,52 +962,52 @@ public class SignatureCreationTest exten
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         properties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_KeyValue);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
-            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(), 
+            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
             "default".toCharArray()
         );
         Key key = keyStore.getKey("transmitter", "default".toCharArray());
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSignatureCreationSKI() throws Exception {
-        
+
         //
         // This test fails with the IBM JDK
         //
         if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
             return;
         }
-        
+
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
@@ -1015,42 +1015,42 @@ public class SignatureCreationTest exten
         properties.setActions(actions);
         properties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_SkiKeyIdentifier);
         properties.setSignatureAlgorithm("http://www.w3.org/2000/09/xmldsig#rsa-sha1");
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("JCEKS");
         keyStore.load(
-            this.getClass().getClassLoader().getResource("test.jceks").openStream(), 
+            this.getClass().getClassLoader().getResource("test.jceks").openStream(),
             "secret".toCharArray()
         );
         Key key = keyStore.getKey("rsakey", "secret".toCharArray());
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("rsakey");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSignatureCreationX509Certificate() throws Exception {
         // Set up the Configuration
@@ -1059,42 +1059,42 @@ public class SignatureCreationTest exten
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         properties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_X509KeyIdentifier);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
-            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(), 
+            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
             "default".toCharArray()
         );
         Key key = keyStore.getKey("transmitter", "default".toCharArray());
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSignatureCreationX509SubjectName() throws Exception {
         // Set up the Configuration
@@ -1103,38 +1103,38 @@ public class SignatureCreationTest exten
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         properties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_X509SubjectName);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
-            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(), 
+            this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
             "default".toCharArray()
         );
         Key key = keyStore.getKey("transmitter", "default".toCharArray());
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
@@ -1184,7 +1184,7 @@ public class SignatureCreationTest exten
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testNoKeyInfo() throws Exception {
         // Set up the Configuration
@@ -1192,7 +1192,7 @@ public class SignatureCreationTest exten
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         KeyStore keyStore = KeyStore.getInstance("jks");
         keyStore.load(
@@ -1206,29 +1206,29 @@ public class SignatureCreationTest exten
 
         properties.setSignatureCanonicalizationAlgorithm("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
         properties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_NoKeyInfo);
-        
-        SecurePart securePart = 
+
+        SecurePart securePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Content);
         properties.addSignaturePart(securePart);
-        
+
         OutboundXMLSec outboundXMLSec = XMLSec.getOutboundXMLSec(properties);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
-        
-        InputStream sourceDocument = 
+
+        InputStream sourceDocument =
                 this.getClass().getClassLoader().getResourceAsStream(
                         "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(sourceDocument);
-        
+
         XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter);
         xmlStreamWriter.close();
-        
+
         // System.out.println("Got:\n" + new String(baos.toByteArray(), "UTF-8"));
-        Document document = 
+        Document document =
             XMLUtils.createDocumentBuilder(false).parse(new ByteArrayInputStream(baos.toByteArray()));
-        
+
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts(), null, false);
-        
+
     }
 }

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureDigestCreationTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureDigestCreationTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureDigestCreationTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureDigestCreationTest.java Tue Dec 15 17:13:17 2015
@@ -53,10 +53,10 @@ import org.junit.Test;
  */
 public class SignatureDigestCreationTest extends AbstractSignatureCreationTest {
     private boolean bcInstalled;
-    
+
     public SignatureDigestCreationTest() throws Exception {
         //
-        // If the BouncyCastle provider is not installed, then try to load it 
+        // If the BouncyCastle provider is not installed, then try to load it
         // via reflection.
         //
         if (Security.getProvider("BC") == null) {
@@ -98,7 +98,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2000/09/xmldsig#sha1";
 
         SecurePart securePart = new SecurePart(
@@ -132,7 +132,7 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSHA224() throws Exception {
         // Set up the Configuration
@@ -151,7 +151,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#sha224";
 
         SecurePart securePart = new SecurePart(
@@ -185,7 +185,7 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSHA256() throws Exception {
         // Set up the Configuration
@@ -204,7 +204,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2001/04/xmlenc#sha256";
 
         SecurePart securePart = new SecurePart(
@@ -238,7 +238,7 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSHA384() throws Exception {
         // Set up the Configuration
@@ -257,7 +257,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#sha384";
 
         SecurePart securePart = new SecurePart(
@@ -291,7 +291,7 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSHA512() throws Exception {
         // Set up the Configuration
@@ -310,7 +310,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2001/04/xmlenc#sha512";
 
         SecurePart securePart = new SecurePart(
@@ -344,7 +344,7 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testRIPEMD160() throws Exception {
         if (!bcInstalled) {
@@ -366,7 +366,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2001/04/xmlenc#ripemd160";
 
         SecurePart securePart = new SecurePart(
@@ -400,7 +400,7 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testWhirlpool() throws Exception {
         if (!bcInstalled) {
@@ -422,7 +422,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#whirlpool";
 
         SecurePart securePart = new SecurePart(
@@ -456,7 +456,7 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSHA3_224() throws Exception {
         if (!bcInstalled) {
@@ -478,7 +478,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#sha3-224";
 
         SecurePart securePart = new SecurePart(
@@ -512,7 +512,7 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSHA3_256() throws Exception {
         if (!bcInstalled) {
@@ -534,7 +534,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#sha3-256";
 
         SecurePart securePart = new SecurePart(
@@ -568,7 +568,7 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSHA3_384() throws Exception {
         if (!bcInstalled) {
@@ -590,7 +590,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#sha3-384";
 
         SecurePart securePart = new SecurePart(
@@ -624,7 +624,7 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testSHA3_512() throws Exception {
         if (!bcInstalled) {
@@ -646,7 +646,7 @@ public class SignatureDigestCreationTest
         properties.setSignatureKey(key);
         X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
         properties.setSignatureCerts(new X509Certificate[]{cert});
-        
+
         String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#sha3-512";
 
         SecurePart securePart = new SecurePart(
@@ -680,5 +680,5 @@ public class SignatureDigestCreationTest
         // Verify using DOM
         verifyUsingDOM(document, cert, properties.getSignatureSecureParts());
     }
-    
+
 }

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureDigestVerificationTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureDigestVerificationTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureDigestVerificationTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureDigestVerificationTest.java Tue Dec 15 17:13:17 2015
@@ -57,18 +57,18 @@ public class SignatureDigestVerification
     private boolean bcInstalled;
     private XMLInputFactory xmlInputFactory;
     private TransformerFactory transformerFactory = TransformerFactory.newInstance();
-    
+
     @Before
     public void setUp() throws Exception {
         Init.init(SignatureDigestVerificationTest.class.getClassLoader().getResource("security-config.xml").toURI(),
                 this.getClass());
         org.apache.xml.security.Init.init();
-        
+
         xmlInputFactory = XMLInputFactory.newInstance();
         xmlInputFactory.setEventAllocator(new XMLSecEventAllocator());
-        
+
         //
-        // If the BouncyCastle provider is not installed, then try to load it 
+        // If the BouncyCastle provider is not installed, then try to load it
         // via reflection.
         //
         if (Security.getProvider("BC") == null) {
@@ -91,7 +91,7 @@ public class SignatureDigestVerification
     public static void cleanup() throws Exception {
         Security.removeProvider("org.bouncycastle.jce.provider.BouncyCastleProvider");
     }
-    
+
     @Test
     public void testSHA1() throws Exception {
         // Read in plaintext document
@@ -113,14 +113,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2000/09/xmldsig#sha1";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -162,14 +162,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#sha224";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -189,7 +189,7 @@ public class SignatureDigestVerification
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testSHA256() throws Exception {
         // Read in plaintext document
@@ -211,14 +211,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2001/04/xmlenc#sha256";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -238,7 +238,7 @@ public class SignatureDigestVerification
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testSHA384() throws Exception {
         // Read in plaintext document
@@ -260,14 +260,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#sha384";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -287,7 +287,7 @@ public class SignatureDigestVerification
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testSHA512() throws Exception {
         // Read in plaintext document
@@ -309,14 +309,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2001/04/xmlenc#sha512";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -336,7 +336,7 @@ public class SignatureDigestVerification
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testRIPEMD160() throws Exception {
         if (!bcInstalled) {
@@ -361,14 +361,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2001/04/xmlenc#ripemd160";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -388,7 +388,7 @@ public class SignatureDigestVerification
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testWhirlpool() throws Exception {
         if (!bcInstalled) {
@@ -413,14 +413,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#whirlpool";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -440,7 +440,7 @@ public class SignatureDigestVerification
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testSHA3_224() throws Exception {
         if (!bcInstalled) {
@@ -465,14 +465,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#sha3-224";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -517,14 +517,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#sha3-256";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -544,7 +544,7 @@ public class SignatureDigestVerification
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testSHA3_384() throws Exception {
         if (!bcInstalled) {
@@ -569,14 +569,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#sha3-384";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -596,7 +596,7 @@ public class SignatureDigestVerification
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testSHA3_512() throws Exception {
         if (!bcInstalled) {
@@ -621,14 +621,14 @@ public class SignatureDigestVerification
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#sha3-512";
-        
+
         XMLSignature sig = signUsingDOM(
                 "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", digestAlgorithm
         );
-        
+
         // Add KeyInfo
         sig.addKeyInfo(cert);
 
@@ -649,5 +649,5 @@ public class SignatureDigestVerification
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
 
-    
+
 }

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureHMACCreationTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureHMACCreationTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureHMACCreationTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureHMACCreationTest.java Tue Dec 15 17:13:17 2015
@@ -47,12 +47,12 @@ import org.w3c.dom.Document;
  * A set of test-cases for Signature creation with various HMAC algorithms
  */
 public class SignatureHMACCreationTest extends AbstractSignatureCreationTest {
-    
+
     private boolean bcInstalled;
-    
+
     public SignatureHMACCreationTest() throws Exception {
         //
-        // If the BouncyCastle provider is not installed, then try to load it 
+        // If the BouncyCastle provider is not installed, then try to load it
         // via reflection.
         //
         if (Security.getProvider("BC") == null) {
@@ -83,15 +83,15 @@ public class SignatureHMACCreationTest e
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         byte[] hmacKey = "secret".getBytes("ASCII");
         String signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#hmac-sha1";
         SecretKey key = new SecretKeySpec(hmacKey, signatureAlgorithm);
         properties.setSignatureKey(key);
-        
+
         properties.setSignatureAlgorithm(signatureAlgorithm);
-        
+
         SecurePart securePart = new SecurePart(
                 new QName("urn:example:po", "PaymentInfo"),
                 SecurePart.Modifier.Content,
@@ -118,7 +118,7 @@ public class SignatureHMACCreationTest e
         // Verify using DOM
         verifyUsingDOM(document, key, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testHMACSHA_224() throws Exception {
         // Set up the Configuration
@@ -126,15 +126,15 @@ public class SignatureHMACCreationTest e
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         byte[] hmacKey = "secret".getBytes("ASCII");
         String signatureAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#hmac-sha224";
         SecretKey key = new SecretKeySpec(hmacKey, signatureAlgorithm);
         properties.setSignatureKey(key);
-        
+
         properties.setSignatureAlgorithm(signatureAlgorithm);
-        
+
         SecurePart securePart = new SecurePart(
                 new QName("urn:example:po", "PaymentInfo"),
                 SecurePart.Modifier.Content,
@@ -161,7 +161,7 @@ public class SignatureHMACCreationTest e
         // Verify using DOM
         verifyUsingDOM(document, key, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testHMACSHA_256() throws Exception {
         // Set up the Configuration
@@ -169,15 +169,15 @@ public class SignatureHMACCreationTest e
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         byte[] hmacKey = "secret".getBytes("ASCII");
         String signatureAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#hmac-sha256";
         SecretKey key = new SecretKeySpec(hmacKey, signatureAlgorithm);
         properties.setSignatureKey(key);
-        
+
         properties.setSignatureAlgorithm(signatureAlgorithm);
-        
+
         SecurePart securePart = new SecurePart(
                 new QName("urn:example:po", "PaymentInfo"),
                 SecurePart.Modifier.Content,
@@ -204,7 +204,7 @@ public class SignatureHMACCreationTest e
         // Verify using DOM
         verifyUsingDOM(document, key, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testHMACSHA_384() throws Exception {
         // Set up the Configuration
@@ -212,15 +212,15 @@ public class SignatureHMACCreationTest e
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         byte[] hmacKey = "secret".getBytes("ASCII");
         String signatureAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#hmac-sha384";
         SecretKey key = new SecretKeySpec(hmacKey, signatureAlgorithm);
         properties.setSignatureKey(key);
-        
+
         properties.setSignatureAlgorithm(signatureAlgorithm);
-        
+
         SecurePart securePart = new SecurePart(
                 new QName("urn:example:po", "PaymentInfo"),
                 SecurePart.Modifier.Content,
@@ -247,7 +247,7 @@ public class SignatureHMACCreationTest e
         // Verify using DOM
         verifyUsingDOM(document, key, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testHMACSHA_512() throws Exception {
         // Set up the Configuration
@@ -255,15 +255,15 @@ public class SignatureHMACCreationTest e
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         byte[] hmacKey = "secret".getBytes("ASCII");
         String signatureAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#hmac-sha512";
         SecretKey key = new SecretKeySpec(hmacKey, signatureAlgorithm);
         properties.setSignatureKey(key);
-        
+
         properties.setSignatureAlgorithm(signatureAlgorithm);
-        
+
         SecurePart securePart = new SecurePart(
                 new QName("urn:example:po", "PaymentInfo"),
                 SecurePart.Modifier.Content,
@@ -290,7 +290,7 @@ public class SignatureHMACCreationTest e
         // Verify using DOM
         verifyUsingDOM(document, key, properties.getSignatureSecureParts());
     }
-    
+
     @Test
     public void testRIPEMD160() throws Exception {
         if (!bcInstalled) {
@@ -301,15 +301,15 @@ public class SignatureHMACCreationTest e
         List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
         actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
-        
+
         // Set the key up
         byte[] hmacKey = "secret".getBytes("ASCII");
         String signatureAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160";
         SecretKey key = new SecretKeySpec(hmacKey, signatureAlgorithm);
         properties.setSignatureKey(key);
-        
+
         properties.setSignatureAlgorithm(signatureAlgorithm);
-        
+
         SecurePart securePart = new SecurePart(
                 new QName("urn:example:po", "PaymentInfo"),
                 SecurePart.Modifier.Content,
@@ -337,5 +337,5 @@ public class SignatureHMACCreationTest e
         verifyUsingDOM(document, key, properties.getSignatureSecureParts());
     }
 
-    
+
 }

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureHMACVerificationTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureHMACVerificationTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureHMACVerificationTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureHMACVerificationTest.java Tue Dec 15 17:13:17 2015
@@ -55,18 +55,18 @@ public class SignatureHMACVerificationTe
     private boolean bcInstalled;
     private XMLInputFactory xmlInputFactory;
     private TransformerFactory transformerFactory = TransformerFactory.newInstance();
-    
+
     @Before
     public void setUp() throws Exception {
         Init.init(SignatureHMACVerificationTest.class.getClassLoader().getResource("security-config.xml").toURI(),
                 this.getClass());
         org.apache.xml.security.Init.init();
-        
+
         xmlInputFactory = XMLInputFactory.newInstance();
         xmlInputFactory.setEventAllocator(new XMLSecEventAllocator());
-        
+
         //
-        // If the BouncyCastle provider is not installed, then try to load it 
+        // If the BouncyCastle provider is not installed, then try to load it
         // via reflection.
         //
         if (Security.getProvider("BC") == null) {
@@ -89,7 +89,7 @@ public class SignatureHMACVerificationTe
     public static void cleanup() throws Exception {
         Security.removeProvider("org.bouncycastle.jce.provider.BouncyCastleProvider");
     }
-    
+
     @Test
     public void testHMACSHA1() throws Exception {
         // Read in plaintext document
@@ -107,14 +107,14 @@ public class SignatureHMACVerificationTe
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         signUsingDOM(
                 signatureAlgorithm, document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", "http://www.w3.org/2000/09/xmldsig#sha1"
         );
-        
+
         // XMLUtils.outputDOM(document, System.out);
-        
+
         // Convert Document to a Stream Reader
         javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -132,7 +132,7 @@ public class SignatureHMACVerificationTe
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testHMACSHA_224() throws Exception {
         // Read in plaintext document
@@ -150,14 +150,14 @@ public class SignatureHMACVerificationTe
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         signUsingDOM(
                 signatureAlgorithm, document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", "http://www.w3.org/2000/09/xmldsig#sha1"
         );
-        
+
         // XMLUtils.outputDOM(document, System.out);
-        
+
         // Convert Document to a Stream Reader
         javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -175,7 +175,7 @@ public class SignatureHMACVerificationTe
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testHMACSHA_256() throws Exception {
         // Read in plaintext document
@@ -193,14 +193,14 @@ public class SignatureHMACVerificationTe
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         signUsingDOM(
                 signatureAlgorithm, document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", "http://www.w3.org/2000/09/xmldsig#sha1"
         );
-        
+
         // XMLUtils.outputDOM(document, System.out);
-        
+
         // Convert Document to a Stream Reader
         javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -218,7 +218,7 @@ public class SignatureHMACVerificationTe
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testHMACSHA_384() throws Exception {
         // Read in plaintext document
@@ -236,14 +236,14 @@ public class SignatureHMACVerificationTe
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         signUsingDOM(
                 signatureAlgorithm, document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", "http://www.w3.org/2000/09/xmldsig#sha1"
         );
-        
+
         // XMLUtils.outputDOM(document, System.out);
-        
+
         // Convert Document to a Stream Reader
         javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -279,14 +279,14 @@ public class SignatureHMACVerificationTe
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         signUsingDOM(
                 signatureAlgorithm, document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", "http://www.w3.org/2000/09/xmldsig#sha1"
         );
-        
+
         // XMLUtils.outputDOM(document, System.out);
-        
+
         // Convert Document to a Stream Reader
         javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -304,7 +304,7 @@ public class SignatureHMACVerificationTe
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
     @Test
     public void testRIPEMD160() throws Exception {
         if (!bcInstalled) {
@@ -325,14 +325,14 @@ public class SignatureHMACVerificationTe
         // Sign using DOM
         List<String> localNames = new ArrayList<String>();
         localNames.add("PaymentInfo");
-        
+
         signUsingDOM(
                 signatureAlgorithm, document, localNames, key,
                 "http://www.w3.org/2001/10/xml-exc-c14n#", "http://www.w3.org/2000/09/xmldsig#sha1"
         );
-        
+
         // XMLUtils.outputDOM(document, System.out);
-        
+
         // Convert Document to a Stream Reader
         javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -350,5 +350,5 @@ public class SignatureHMACVerificationTe
 
         StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
     }
-    
+
 }

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureVerificationReferenceURIResolverTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureVerificationReferenceURIResolverTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureVerificationReferenceURIResolverTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureVerificationReferenceURIResolverTest.java Tue Dec 15 17:13:17 2015
@@ -151,7 +151,7 @@ public class SignatureVerificationRefere
 
         File file = new File(BASEDIR +
                 "/target/test-classes/org/apache/xml/security/test/stax/signature/SignatureVerificationReferenceURIResolverTest.class").getCanonicalFile();
-        
+
         ReferenceInfo referenceInfo = new ReferenceInfo(
                 file.toURI().toString(),
                 null,