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 [11/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/javax/xml/crypto/test/KeySelectors.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/KeySelectors.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/KeySelectors.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/KeySelectors.java Tue Dec 15 17:13:17 2015
@@ -40,7 +40,7 @@ import javax.crypto.SecretKey;
public class KeySelectors {
/**
- * KeySelector which would always return the secret key specified in its
+ * KeySelector which would always return the secret key specified in its
* constructor.
*/
public static class SecretKeySelector extends KeySelector {
@@ -51,15 +51,15 @@ public class KeySelectors {
public SecretKeySelector(SecretKey key) {
this.key = key;
}
-
- public KeySelectorResult select(KeyInfo ki,
+
+ public KeySelectorResult select(KeyInfo ki,
KeySelector.Purpose purpose,
- AlgorithmMethod method,
- XMLCryptoContext context)
+ AlgorithmMethod method,
+ XMLCryptoContext context)
throws KeySelectorException {
return new SimpleKSResult(key);
}
-
+
private SecretKey wrapBytes(final byte[] bytes) {
return new SecretKey() {
private static final long serialVersionUID = 3457835482691931082L;
@@ -67,11 +67,11 @@ public class KeySelectors {
public String getFormat() {
return "RAW";
}
-
+
public String getAlgorithm() {
return "Secret key";
}
-
+
public byte[] getEncoded() {
return bytes.clone();
}
@@ -80,21 +80,21 @@ public class KeySelectors {
}
/**
- * KeySelector which would retrieve the X509Certificate out of the
+ * KeySelector which would retrieve the X509Certificate out of the
* KeyInfo element and return the public key.
* NOTE: If there is an X509CRL in the KeyInfo element, then revoked
* certificate will be ignored.
*/
public static class RawX509KeySelector extends KeySelector {
-
- public KeySelectorResult select(KeyInfo keyInfo,
- KeySelector.Purpose purpose,
- AlgorithmMethod method,
- XMLCryptoContext context)
+
+ public KeySelectorResult select(KeyInfo keyInfo,
+ KeySelector.Purpose purpose,
+ AlgorithmMethod method,
+ XMLCryptoContext context)
throws KeySelectorException {
if (keyInfo == null) {
throw new KeySelectorException("Null KeyInfo object!");
- }
+ }
// search for X509Data in keyinfo
@SuppressWarnings("unchecked")
Iterator<XMLStructure> iter = keyInfo.getContent().iterator();
@@ -116,8 +116,8 @@ public class KeySelectors {
Object o = xi.next();
// skip non-X509Certificate entries
if (o instanceof X509Certificate) {
- if ((purpose != KeySelector.Purpose.VERIFY) &&
- (crl != null) &&
+ if ((purpose != KeySelector.Purpose.VERIFY) &&
+ (crl != null) &&
crl.isRevoked((X509Certificate)o)) {
continue;
} else {
@@ -133,23 +133,23 @@ public class KeySelectors {
}
/**
- * KeySelector which would retrieve the public key out of the
+ * KeySelector which would retrieve the public key out of the
* KeyValue element and return it.
* NOTE: If the key algorithm doesn't match signature algorithm,
* then the public key will be ignored.
*/
public static class KeyValueKeySelector extends KeySelector {
- public KeySelectorResult select(KeyInfo keyInfo,
- KeySelector.Purpose purpose,
- AlgorithmMethod method,
- XMLCryptoContext context)
+ public KeySelectorResult select(KeyInfo keyInfo,
+ KeySelector.Purpose purpose,
+ AlgorithmMethod method,
+ XMLCryptoContext context)
throws KeySelectorException {
if (keyInfo == null) {
throw new KeySelectorException("Null KeyInfo object!");
}
@SuppressWarnings("unchecked")
List<XMLStructure> list = keyInfo.getContent();
-
+
for (XMLStructure xmlStructure : list) {
if (xmlStructure instanceof KeyValue) {
PublicKey pk = null;
@@ -167,7 +167,7 @@ public class KeySelectors {
/**
* KeySelector which would perform special lookup as documented
- * by the ie/baltimore/merlin-examples testcases and return the
+ * by the ie/baltimore/merlin-examples testcases and return the
* matching public key.
*/
public static class CollectionKeySelector extends KeySelector {
@@ -179,7 +179,7 @@ public class KeySelectors {
private static final int MATCH_SERIAL = 2;
private static final int MATCH_SUBJECT_KEY_ID = 3;
private static final int MATCH_CERTIFICATE = 4;
-
+
public CollectionKeySelector(File dir) throws CertificateException {
certDir = dir;
certFac = CertificateFactory.getInstance("X509");
@@ -207,14 +207,14 @@ public class KeySelectors {
}
}
}
-
+
public List<X509Certificate> match(
int matchType, Object value, List<X509Certificate> pool
) {
List<X509Certificate> matchResult = new ArrayList<X509Certificate>();
-
+
for (X509Certificate c : pool) {
-
+
switch (matchType) {
case MATCH_SUBJECT:
Principal p1 = new javax.security.auth.x500.X500Principal((String)value);
@@ -232,7 +232,7 @@ public class KeySelectors {
if (c.getSerialNumber().equals(value)) {
matchResult.add(c);
}
-
+
break;
case MATCH_SUBJECT_KEY_ID:
byte[] extension = c.getExtensionValue("2.5.29.14");
@@ -254,11 +254,11 @@ public class KeySelectors {
}
return matchResult;
}
-
- public KeySelectorResult select(KeyInfo keyInfo,
- KeySelector.Purpose purpose,
- AlgorithmMethod method,
- XMLCryptoContext context)
+
+ public KeySelectorResult select(KeyInfo keyInfo,
+ KeySelector.Purpose purpose,
+ AlgorithmMethod method,
+ XMLCryptoContext context)
throws KeySelectorException {
if (keyInfo == null) {
throw new KeySelectorException("Null KeyInfo object!");
@@ -272,11 +272,11 @@ public class KeySelectors {
String name = ((KeyName)xmlStructure).getName();
PublicKey pk = null;
try {
- // Lookup the public key using the key name 'Xxx',
+ // Lookup the public key using the key name 'Xxx',
// i.e. the public key is in "certs/xxx.crt".
File certFile = new File(new File(certDir, "certs"),
name.toLowerCase()+".crt");
- X509Certificate cert = (X509Certificate)
+ X509Certificate cert = (X509Certificate)
certFac.generateCertificate
(new FileInputStream(certFile));
pk = cert.getPublicKey();
@@ -287,7 +287,7 @@ public class KeySelectors {
int numOfMatches = (result == null? 0 : result.size());
if (numOfMatches != 1) {
throw new KeySelectorException
- ((numOfMatches == 0 ? "No":"More than one") +
+ ((numOfMatches == 0 ? "No":"More than one") +
" match found");
}
pk = ((X509Certificate)result.get(0)).getPublicKey();
@@ -300,7 +300,7 @@ public class KeySelectors {
String type = rm.getType();
if (type.equals(X509Data.RAW_X509_CERTIFICATE_TYPE)) {
String uri = rm.getURI();
- X509Certificate cert = (X509Certificate)
+ X509Certificate cert = (X509Certificate)
certFac.generateCertificate
(new FileInputStream(new File(certDir, uri)));
return new SimpleKSResult(cert.getPublicKey());
@@ -313,7 +313,7 @@ public class KeySelectors {
List<Object> content = ((X509Data)xmlStructure).getContent();
int size = content.size();
List<X509Certificate> result = null;
- // Lookup the public key using the information
+ // Lookup the public key using the information
// specified in X509Data element, i.e. searching
// over the collection of certificate files under
// "certs" subdirectory and return those match.
@@ -327,9 +327,9 @@ public class KeySelectors {
result = match(MATCH_CERTIFICATE, obj, certs);
} else if (obj instanceof X509IssuerSerial) {
X509IssuerSerial is = (X509IssuerSerial) obj;
- result = match(MATCH_SERIAL,
+ result = match(MATCH_SERIAL,
is.getSerialNumber(), certs);
- result = match(MATCH_ISSUER,
+ result = match(MATCH_ISSUER,
is.getIssuerName(), result);
} else {
throw new KeySelectorException("Unsupported X509Data: " + obj);
@@ -338,7 +338,7 @@ public class KeySelectors {
int numOfMatches = (result == null ? 0 : result.size());
if (numOfMatches != 1) {
throw new KeySelectorException
- ((numOfMatches==0?"No":"More than one") +
+ ((numOfMatches==0?"No":"More than one") +
" match found");
}
return new SimpleKSResult(((X509Certificate)
@@ -351,12 +351,12 @@ public class KeySelectors {
throw new KeySelectorException("No matching key found!");
}
}
-
+
public static class ByteUtil {
-
+
private static String mapping = "0123456789ABCDEF";
private static int numBytesPerRow = 6;
-
+
private static String getHex(byte value) {
int low = value & 0x0f;
int high = ((value >> 4) & 0x0f);
@@ -388,12 +388,12 @@ public class KeySelectors {
return buf.toString();
}
}
-
+
private static class SimpleKSResult implements KeySelectorResult {
private final Key key;
-
+
SimpleKSResult(Key key) { this.key = key; }
-
+
public Key getKey() { return key; }
}
}
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/OctetStreamDataTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/OctetStreamDataTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/OctetStreamDataTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/OctetStreamDataTest.java Tue Dec 15 17:13:17 2015
@@ -34,16 +34,16 @@ public class OctetStreamDataTest extends
@org.junit.Test
public void testConstructor() {
- // test OctetStreamData(InputStream) and
+ // test OctetStreamData(InputStream) and
// OctetStreamData(InputStream, String, String)
OctetStreamData osdata;
try {
- osdata = new OctetStreamData(null);
- fail("Should raise a NPE for null input stream");
+ osdata = new OctetStreamData(null);
+ fail("Should raise a NPE for null input stream");
} catch (NullPointerException npe) {}
try {
osdata = new OctetStreamData(null, "uri", "mimeType");
- fail("Should raise a NPE for null input stream");
+ fail("Should raise a NPE for null input stream");
} catch (NullPointerException npe) {}
int len = 300;
@@ -51,12 +51,12 @@ public class OctetStreamDataTest extends
new Random().nextBytes(in);
ByteArrayInputStream bais = new ByteArrayInputStream(in);
try {
- osdata = new OctetStreamData(bais);
+ osdata = new OctetStreamData(bais);
assertNotNull(osdata);
assertEquals(osdata.getOctetStream(), bais);
assertNull(osdata.getURI());
assertNull(osdata.getMimeType());
-
+
osdata = new OctetStreamData(bais, null, null);
assertNotNull(osdata);
assertEquals(osdata.getOctetStream(), bais);
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Baltimore18Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Baltimore18Test.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Baltimore18Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Baltimore18Test.java Tue Dec 15 17:13:17 2015
@@ -30,7 +30,7 @@ import javax.xml.crypto.URIDereferencer;
import javax.xml.crypto.test.KeySelectors;
/**
- * This is a testcase to validate all "merlin-xmldsig-eighteen"
+ * This is a testcase to validate all "merlin-xmldsig-eighteen"
* testcases from Baltimore
*
* @author Sean Mullan
@@ -48,7 +48,7 @@ public class Baltimore18Test extends org
public Baltimore18Test() throws CertificateException {
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
-
+
String fs = System.getProperty("file.separator");
dir = new File(base + fs + "src/test/resources" + fs + "ie" +
fs + "baltimore" + fs + "merlin-examples",
@@ -56,16 +56,16 @@ public class Baltimore18Test extends org
cks = new KeySelectors.CollectionKeySelector(dir);
ud = new LocalHttpCacheURIDereferencer();
}
-
+
@org.junit.Test
public void testSignatureKeyname() throws Exception {
String file = "signature-keyname.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate(file, cks, ud);
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void testSignatureRetrievalmethodRawx509crt() throws Exception {
String file = "signature-retrievalmethod-rawx509crt.xml";
@@ -92,7 +92,7 @@ public class Baltimore18Test extends org
boolean coreValidity = validator.validate(file, cks, ud);
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void testSignatureX509Is() throws Exception {
String file = "signature-x509-is.xml";
@@ -101,7 +101,7 @@ public class Baltimore18Test extends org
boolean coreValidity = validator.validate(file, cks, ud);
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void testSignatureX509Ski() throws Exception {
String file = "signature-x509-ski.xml";
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Baltimore23Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Baltimore23Test.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Baltimore23Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Baltimore23Test.java Tue Dec 15 17:13:17 2015
@@ -32,7 +32,7 @@ import javax.xml.crypto.dsig.XMLSignatur
import javax.xml.crypto.test.KeySelectors;
/**
- * This is a testcase to validate all "merlin-xmldsig-twenty-three"
+ * This is a testcase to validate all "merlin-xmldsig-twenty-three"
* testcases from Baltimore
*
* @author Sean Mullan
@@ -50,8 +50,8 @@ public class Baltimore23Test extends org
public Baltimore23Test() {
String fs = System.getProperty("file.separator");
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
-
- dir = new File(base + fs + "src/test/resources" + fs
+
+ dir = new File(base + fs + "src/test/resources" + fs
+ "ie" + fs + "baltimore" + fs + "merlin-examples",
"merlin-xmldsig-twenty-three");
ud = new LocalHttpCacheURIDereferencer();
@@ -66,21 +66,21 @@ public class Baltimore23Test extends org
(file, new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_signature_enveloping_b64_dsa() throws Exception {
String file = "signature-enveloping-b64-dsa.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_signature_enveloping_dsa() throws Exception {
String file = "signature-enveloping-dsa.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.KeyValueKeySelector());
@@ -90,7 +90,7 @@ public class Baltimore23Test extends org
@org.junit.Test
public void test_signature_external_b64_dsa() throws Exception {
String file = "signature-external-b64-dsa.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.KeyValueKeySelector(), ud);
@@ -100,17 +100,17 @@ public class Baltimore23Test extends org
@org.junit.Test
public void test_signature_external_dsa() throws Exception {
String file = "signature-external-dsa.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.KeyValueKeySelector(), ud);
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_signature_enveloping_rsa() throws Exception {
String file = "signature-enveloping-rsa.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.KeyValueKeySelector());
@@ -120,7 +120,7 @@ public class Baltimore23Test extends org
@org.junit.Test
public void test_signature_enveloping_hmac_sha1() throws Exception {
String file = "signature-enveloping-hmac-sha1.xml";
-
+
KeySelector ks = new KeySelectors.SecretKeySelector
("secret".getBytes("ASCII") );
SignatureValidator validator = new SignatureValidator(dir);
@@ -131,7 +131,7 @@ public class Baltimore23Test extends org
@org.junit.Test
public void test_signature_enveloping_hmac_sha1_40() throws Exception {
String file = "signature-enveloping-hmac-sha1-40.xml";
-
+
KeySelector ks = new KeySelectors.SecretKeySelector
("secret".getBytes("ASCII") );
try {
@@ -147,27 +147,27 @@ public class Baltimore23Test extends org
@org.junit.Test
public void test_signature_keyname() throws Exception {
String file = "signature-keyname.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.CollectionKeySelector(dir), ud);
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_signature_retrievalmethod_rawx509crt() throws Exception {
String file = "signature-retrievalmethod-rawx509crt.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.CollectionKeySelector(dir), ud);
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_signature_x509_crt_crl() throws Exception {
String file = "signature-x509-crt-crl.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.RawX509KeySelector(), ud);
@@ -177,27 +177,27 @@ public class Baltimore23Test extends org
@org.junit.Test
public void test_signature_x509_crt() throws Exception {
String file = "signature-x509-crt.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.RawX509KeySelector(), ud);
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_signature_x509_is() throws Exception {
String file = "signature-x509-is.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.CollectionKeySelector(dir), ud);
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_signature_x509_ski() throws Exception {
String file = "signature-x509-ski.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.CollectionKeySelector(dir), ud);
@@ -207,7 +207,7 @@ public class Baltimore23Test extends org
@org.junit.Test
public void test_signature_x509_sn() throws Exception {
String file = "signature-x509-sn.xml";
-
+
SignatureValidator validator = new SignatureValidator(dir);
boolean coreValidity = validator.validate
(file, new KeySelectors.CollectionKeySelector(dir), ud);
@@ -216,18 +216,18 @@ public class Baltimore23Test extends org
@org.junit.Test
public void test_signature() throws Exception {
-
+
//
// This test fails with the IBM JDK
//
if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
return;
}
-
+
String file = "signature.xml";
String fs = System.getProperty("file.separator");
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
-
+
String keystore = base + fs + "src/test/resources" + fs +
"ie" + fs + "baltimore" + fs + "merlin-examples" + fs +
"merlin-xmldsig-twenty-three" + fs + "certs" + fs + "xmldsig.jks";
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreExcC14n1Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreExcC14n1Test.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreExcC14n1Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreExcC14n1Test.java Tue Dec 15 17:13:17 2015
@@ -27,7 +27,7 @@ import java.security.Security;
import javax.xml.crypto.test.KeySelectors;
/**
- * This is a testcase to validate all "merlin-exc-c14n-one"
+ * This is a testcase to validate all "merlin-exc-c14n-one"
* testcases from Baltimore
*
* @author Sean Mullan
@@ -44,7 +44,7 @@ public class BaltimoreExcC14n1Test exten
public BaltimoreExcC14n1Test() {
String fs = System.getProperty("file.separator");
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
-
+
base += fs + "src/test/resources" + fs + "ie" +
fs + "baltimore" + fs + "merlin-examples";
validator = new SignatureValidator(new File
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreIaik2Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreIaik2Test.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreIaik2Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreIaik2Test.java Tue Dec 15 17:13:17 2015
@@ -27,7 +27,7 @@ import java.security.Security;
import javax.xml.crypto.test.KeySelectors;
/**
- * This is a testcase to validate all "ec-merlin-iaikTests-two"
+ * This is a testcase to validate all "ec-merlin-iaikTests-two"
* testcases from Baltimore
*
* @author Sean Mullan
@@ -45,7 +45,7 @@ public class BaltimoreIaik2Test extends
public BaltimoreIaik2Test() {
String fs = System.getProperty("file.separator");
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
-
+
dir = new File(base + fs + "src/test/resources" + fs +
"ie" + fs + "baltimore" + fs + "merlin-examples",
"ec-merlin-iaikTests-two");
@@ -58,6 +58,6 @@ public class BaltimoreIaik2Test extends
boolean coreValidity = validator.validate
(file, new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
- }
+ }
}
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreXPathFilter2ThreeTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreXPathFilter2ThreeTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreXPathFilter2ThreeTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/BaltimoreXPathFilter2ThreeTest.java Tue Dec 15 17:13:17 2015
@@ -49,31 +49,31 @@ public class BaltimoreXPathFilter2ThreeT
validator = new SignatureValidator(new File
(base, "merlin-xpath-filter2-three"));
}
-
+
@org.junit.Test
public void testSignSpec() throws Exception {
String file = "sign-spec.xml";
- boolean coreValidity = validator.validate(file,
+ boolean coreValidity = validator.validate(file,
new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation#1", coreValidity);
- coreValidity = validator.validate(file,
+ coreValidity = validator.validate(file,
new KeySelectors.RawX509KeySelector());
assertTrue("Signature failed core validation#2", coreValidity);
}
-
+
@org.junit.Test
public void testSignXfdl() throws Exception {
String file = "sign-xfdl.xml";
- boolean coreValidity = validator.validate(file,
+ boolean coreValidity = validator.validate(file,
new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation#1", coreValidity);
- coreValidity = validator.validate(file,
+ coreValidity = validator.validate(file,
new KeySelectors.RawX509KeySelector());
assertTrue("Signature failed core validation#2", coreValidity);
}
-
+
}
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CanonicalizationMethodTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CanonicalizationMethodTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CanonicalizationMethodTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CanonicalizationMethodTest.java Tue Dec 15 17:13:17 2015
@@ -49,14 +49,14 @@ public class CanonicalizationMethodTest
CanonicalizationMethod.EXCLUSIVE
};
- public CanonicalizationMethodTest() throws Exception {
+ public CanonicalizationMethodTest() throws Exception {
factory = XMLSignatureFactory.getInstance
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
}
@org.junit.Test
public void testIsFeatureSupported() throws Exception {
- CanonicalizationMethod cm;
+ CanonicalizationMethod cm;
for (int i = 0; i < C14N_ALGOS.length; i++) {
String algo = C14N_ALGOS[i];
ExcC14NParameterSpec params = null;
@@ -65,35 +65,35 @@ public class CanonicalizationMethodTest
}
cm = factory.newCanonicalizationMethod(algo, params);
try {
- cm.isFeatureSupported(null);
- fail("Should raise a NPE for null feature");
+ cm.isFeatureSupported(null);
+ fail("Should raise a NPE for null feature");
} catch (NullPointerException npe) {}
-
+
assertTrue(!cm.isFeatureSupported("not supported"));
}
}
@org.junit.Test
public void testConstructor() throws Exception {
- // test newAlgorithmMethod(String algorithm,
+ // test newAlgorithmMethod(String algorithm,
// AlgorithmParameterSpec params)
// for generating CanonicalizationMethod objects
- CanonicalizationMethod cm;
+ CanonicalizationMethod cm;
for (int i = 0; i < C14N_ALGOS.length; i++) {
String algo = C14N_ALGOS[i];
- cm = factory.newCanonicalizationMethod(algo,
+ cm = factory.newCanonicalizationMethod(algo,
(C14NMethodParameterSpec) null);
assertNotNull(cm);
assertEquals(cm.getAlgorithm(), algo);
assertNull(cm.getParameterSpec());
-
+
try {
cm = factory.newCanonicalizationMethod
(algo, new TestUtils.MyOwnC14nParameterSpec());
- fail("Should raise an IAPE for invalid c14n parameters");
+ fail("Should raise an IAPE for invalid c14n parameters");
} catch (InvalidAlgorithmParameterException iape) {
} catch (Exception ex) {
- fail("Should raise a IAPE instead of " + ex);
+ fail("Should raise a IAPE instead of " + ex);
}
if (algo.equals(CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS) ||
algo.equals(CanonicalizationMethod.EXCLUSIVE)) {
@@ -107,22 +107,22 @@ public class CanonicalizationMethodTest
}
try {
- cm = factory.newCanonicalizationMethod(null,
- (C14NMethodParameterSpec) null);
- fail("Should raise a NPE for null algo");
+ cm = factory.newCanonicalizationMethod(null,
+ (C14NMethodParameterSpec) null);
+ fail("Should raise a NPE for null algo");
} catch (NullPointerException npe) {
} catch (Exception ex) {
- fail("Should raise a NPE instead of " + ex);
+ fail("Should raise a NPE instead of " + ex);
}
try {
- cm = factory.newCanonicalizationMethod("non-existent",
- (C14NMethodParameterSpec) null);
- fail("Should raise an NSAE for non-existent algos");
+ cm = factory.newCanonicalizationMethod("non-existent",
+ (C14NMethodParameterSpec) null);
+ fail("Should raise an NSAE for non-existent algos");
} catch (NoSuchAlgorithmException nsae) {
} catch (Exception ex) {
- fail("Should raise an NSAE instead of " + ex);
+ fail("Should raise an NSAE instead of " + ex);
}
}
-
+
}
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/ClassLoaderTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/ClassLoaderTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/ClassLoaderTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/ClassLoaderTest.java Tue Dec 15 17:13:17 2015
@@ -31,12 +31,12 @@ import org.apache.jcp.xml.dsig.internal.
/**
* This test uses more than one classloader to load a class (Driver) that
- * invokes the XMLSignature API. It tests that there are not provider class
+ * invokes the XMLSignature API. It tests that there are not provider class
* loading issues with more than one classloader (see 6380953).
*/
public class ClassLoaderTest extends org.junit.Assert {
-
- private static org.slf4j.Logger log =
+
+ private static org.slf4j.Logger log =
org.slf4j.LoggerFactory.getLogger(ClassLoaderTest.class);
@SuppressWarnings("resource")
@@ -86,8 +86,8 @@ public class ClassLoaderTest extends org
return null;
}
});
- // get the provider from java.security.Security using URLClassLoader.
- // Need to use introspection to invoke methods to avoid using the
+ // get the provider from java.security.Security using URLClassLoader.
+ // Need to use introspection to invoke methods to avoid using the
// current class loader
String factoryName = "javax.xml.crypto.dsig.XMLSignatureFactory";
Class<?> factoryClass = uc1.loadClass(factoryName);
@@ -96,7 +96,7 @@ public class ClassLoaderTest extends org
Class<?> methodParameterClass = uc1.loadClass
("javax.xml.crypto.dsig.spec.C14NMethodParameterSpec");
Method canonicalizationMethod = factoryClass.getDeclaredMethod
- ("newCanonicalizationMethod",
+ ("newCanonicalizationMethod",
new Class[]{String.class,methodParameterClass});
Object factory = factoryMethod.invoke(null, "DOM");
long start = System.currentTimeMillis();
@@ -136,5 +136,5 @@ public class ClassLoaderTest extends org
m1.invoke(o1, (Object[]) null);
m2.invoke(o2, (Object[]) null);
}
-
+
}
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/ComRSASecurityTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/ComRSASecurityTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/ComRSASecurityTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/ComRSASecurityTest.java Tue Dec 15 17:13:17 2015
@@ -27,7 +27,7 @@ import java.security.Security;
import javax.xml.crypto.test.KeySelectors;
/**
- * This is a testcase to validate all "bdournaee"
+ * This is a testcase to validate all "bdournaee"
* testcases from RSA
*
* @author Sean Mullan
@@ -44,12 +44,12 @@ public class ComRSASecurityTest extends
public ComRSASecurityTest() {
String fs = System.getProperty("file.separator");
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
-
+
base += fs + "src/test/resources" + fs + "com";
validator = new SignatureValidator(new File
(base, "rsasecurity/bdournaee"));
}
-
+
@org.junit.Test
public void test_certj201_enveloping() throws Exception {
String file = "certj201_enveloping.xml";
@@ -58,7 +58,7 @@ public class ComRSASecurityTest extends
(file, new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_certj201_enveloped() throws Exception {
String file = "certj201_enveloped.xml";
@@ -67,5 +67,5 @@ public class ComRSASecurityTest extends
(file, new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
}
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateBaltimore23Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateBaltimore23Test.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateBaltimore23Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateBaltimore23Test.java Tue Dec 15 17:13:17 2015
@@ -71,7 +71,7 @@ public class CreateBaltimore23Test exten
private DigestMethod sha1;
private KeyInfo dsa, rsa;
private KeySelector kvks = new KeySelectors.KeyValueKeySelector();
- private KeySelector sks;
+ private KeySelector sks;
private Key signingKey;
private PublicKey validatingKey;
private Certificate signingCert;
@@ -105,7 +105,7 @@ public class CreateBaltimore23Test exten
withoutComments = fac.newCanonicalizationMethod
(CanonicalizationMethod.INCLUSIVE, (C14NMethodParameterSpec) null);
withComments = fac.newTransform
- (CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
+ (CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
(TransformParameterSpec) null);
dsaSha1 = fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null);
sha1 = fac.newDigestMethod(DigestMethod.SHA1, null);
@@ -126,8 +126,8 @@ public class CreateBaltimore23Test exten
(withoutComments, dsaSha1, Collections.singletonList
(fac.newReference
("", sha1, Collections.singletonList
- (fac.newTransform(Transform.ENVELOPED,
- (TransformParameterSpec) null)),
+ (fac.newTransform(Transform.ENVELOPED,
+ (TransformParameterSpec) null)),
null, null)));
// create XMLSignature
@@ -165,7 +165,7 @@ public class CreateBaltimore23Test exten
}
@org.junit.Test
- public void test_create_signature_enveloping_hmac_sha1_40()
+ public void test_create_signature_enveloping_hmac_sha1_40()
throws Exception {
SignatureMethod hmacSha1 = fac.newSignatureMethod
(SignatureMethod.HMAC_SHA1, new HMACParameterSpec(40));
@@ -190,7 +190,7 @@ public class CreateBaltimore23Test exten
@org.junit.Test
public void test_create_signature_enveloping_rsa() throws Exception {
- test_create_signature_enveloping(rsaSha1, rsa,
+ test_create_signature_enveloping(rsaSha1, rsa,
TestUtils.getPrivateKey("RSA"), kvks, false);
}
@@ -213,7 +213,7 @@ public class CreateBaltimore23Test exten
}
@org.junit.Test
- public void test_create_signature_retrievalmethod_rawx509crt()
+ public void test_create_signature_retrievalmethod_rawx509crt()
throws Exception {
KeyInfo rm = kifac.newKeyInfo(Collections.singletonList
(kifac.newRetrievalMethod
@@ -224,14 +224,14 @@ public class CreateBaltimore23Test exten
@org.junit.Test
public void test_create_signature_x509_crt_crl() throws Exception {
-
+
//
// This test fails with the IBM JDK
//
if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
return;
}
-
+
List<Object> xds = new ArrayList<Object>();
CertificateFactory cf = CertificateFactory.getInstance("X.509");
xds.add(signingCert);
@@ -239,7 +239,7 @@ public class CreateBaltimore23Test exten
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
FileInputStream fis = new FileInputStream(
base + fs + "src/test/resources" + fs + "ie" + fs +
- "baltimore" + fs + "merlin-examples" + fs +
+ "baltimore" + fs + "merlin-examples" + fs +
"merlin-xmldsig-twenty-three" + fs + "certs" + fs + "crl");
X509CRL crl = (X509CRL) cf.generateCRL(fis);
fis.close();
@@ -259,7 +259,7 @@ public class CreateBaltimore23Test exten
if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
return;
}
-
+
KeyInfo crt = kifac.newKeyInfo(Collections.singletonList
(kifac.newX509Data(Collections.singletonList(signingCert))));
@@ -275,7 +275,7 @@ public class CreateBaltimore23Test exten
if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
return;
}
-
+
KeyInfo is = kifac.newKeyInfo(Collections.singletonList
(kifac.newX509Data(Collections.singletonList
(kifac.newX509IssuerSerial
@@ -303,7 +303,7 @@ public class CreateBaltimore23Test exten
if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
return;
}
-
+
KeyInfo sn = kifac.newKeyInfo(Collections.singletonList
(kifac.newX509Data(Collections.singletonList
("CN=Sean Mullan,DC=sun,DC=com"))));
@@ -314,35 +314,35 @@ public class CreateBaltimore23Test exten
@org.junit.Test
public void test_create_signature() throws Exception {
-
+
//
// This test fails with the IBM JDK
//
if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
return;
}
-
+
// set up reusable objects
- Transform env = fac.newTransform(Transform.ENVELOPED,
+ Transform env = fac.newTransform(Transform.ENVELOPED,
(TransformParameterSpec) null);
// create references
List<Reference> refs = new ArrayList<Reference>();
-
+
// Reference 1
refs.add(fac.newReference("http://www.w3.org/TR/xml-stylesheet", sha1));
// Reference 2
refs.add(fac.newReference
- ("http://www.w3.org/Signature/2002/04/xml-stylesheet.b64",
+ ("http://www.w3.org/Signature/2002/04/xml-stylesheet.b64",
sha1, Collections.singletonList
- (fac.newTransform(Transform.BASE64,
+ (fac.newTransform(Transform.BASE64,
(TransformParameterSpec) null)), null, null));
// Reference 3
refs.add(fac.newReference("#object-1", sha1, Collections.singletonList
- (fac.newTransform(Transform.XPATH,
- new XPathFilterParameterSpec("self::text()"))),
+ (fac.newTransform(Transform.XPATH,
+ new XPathFilterParameterSpec("self::text()"))),
XMLObject.TYPE, null));
// Reference 4
@@ -373,7 +373,7 @@ public class CreateBaltimore23Test exten
("#manifest-1", sha1, null, Manifest.TYPE, null));
// Reference 7
- refs.add(fac.newReference("#signature-properties-1", sha1, null,
+ refs.add(fac.newReference("#signature-properties-1", sha1, null,
SignatureProperties.TYPE, null));
// Reference 8
@@ -390,7 +390,7 @@ public class CreateBaltimore23Test exten
sha1, Collections.singletonList(env), null, null));
// Reference 11
- refs.add(fac.newReference("#xpointer(/)", sha1, transforms,
+ refs.add(fac.newReference("#xpointer(/)", sha1, transforms,
null, null));
// Reference 12
@@ -398,15 +398,15 @@ public class CreateBaltimore23Test exten
(fac.newReference("#object-3", sha1, null, XMLObject.TYPE, null));
// Reference 13
- refs.add(fac.newReference("#object-3", sha1,
+ refs.add(fac.newReference("#object-3", sha1,
Collections.singletonList(withComments), XMLObject.TYPE, null));
// Reference 14
- refs.add(fac.newReference("#xpointer(id('object-3'))", sha1, null,
+ refs.add(fac.newReference("#xpointer(id('object-3'))", sha1, null,
XMLObject.TYPE, null));
// Reference 15
- refs.add(fac.newReference("#xpointer(id('object-3'))", sha1,
+ refs.add(fac.newReference("#xpointer(id('object-3'))", sha1,
Collections.singletonList(withComments), XMLObject.TYPE, null));
// Reference 16
@@ -427,7 +427,7 @@ public class CreateBaltimore23Test exten
XPathFilterParameterSpec xpf = new XPathFilterParameterSpec(
"ancestor-or-self::dsig:X509Data",
Collections.singletonMap("dsig", XMLSignature.XMLNS));
- RetrievalMethod rm = kifac.newRetrievalMethod("#object-4",
+ RetrievalMethod rm = kifac.newRetrievalMethod("#object-4",
X509Data.TYPE, Collections.singletonList(fac.newTransform
(Transform.XPATH, xpf)));
KeyInfo ki = kifac.newKeyInfo(Collections.singletonList(rm), null);
@@ -439,12 +439,12 @@ public class CreateBaltimore23Test exten
// Object 1
objs.add(fac.newXMLObject(Collections.singletonList
- (new DOMStructure(doc.createTextNode("I am the text."))),
+ (new DOMStructure(doc.createTextNode("I am the text."))),
"object-1", "text/plain", null));
// Object 2
objs.add(fac.newXMLObject(Collections.singletonList
- (new DOMStructure(doc.createTextNode("SSBhbSB0aGUgdGV4dC4="))),
+ (new DOMStructure(doc.createTextNode("SSBhbSB0aGUgdGV4dC4="))),
"object-2", "text/plain", Transform.BASE64));
// Object 3
@@ -496,9 +496,9 @@ public class CreateBaltimore23Test exten
Document docxslt = db.parse(new ByteArrayInputStream(xslt.getBytes()));
Node xslElem = docxslt.getDocumentElement();
- manTrans.add(fac.newTransform(Transform.XSLT,
+ manTrans.add(fac.newTransform(Transform.XSLT,
new XSLTTransformParameterSpec(new DOMStructure(xslElem))));
- manTrans.add(fac.newTransform(CanonicalizationMethod.INCLUSIVE,
+ manTrans.add(fac.newTransform(CanonicalizationMethod.INCLUSIVE,
(TransformParameterSpec) null));
// Comment out Manifest Reference 3, for some reason xalan is throwing NPE
// when Transform is processed.
@@ -514,11 +514,11 @@ public class CreateBaltimore23Test exten
ip.appendChild(doc.createTextNode("192.168.21.138"));
sa.appendChild(ip);
SignatureProperty sp = fac.newSignatureProperty
- (Collections.singletonList(new DOMStructure(sa)),
+ (Collections.singletonList(new DOMStructure(sa)),
"#signature", null);
SignatureProperties sps = fac.newSignatureProperties
(Collections.singletonList(sp), "signature-properties-1");
- objs.add(fac.newXMLObject(Collections.singletonList(sps), null,
+ objs.add(fac.newXMLObject(Collections.singletonList(sps), null,
null, null));
// Object 4
@@ -537,19 +537,19 @@ public class CreateBaltimore23Test exten
// create envelope header
Element envelope = doc.createElementNS
("http://example.org/usps", "Envelope");
- envelope.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
+ envelope.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
"http://example.org/usps");
- envelope.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:foo",
+ envelope.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:foo",
"http://example.org/foo");
doc.appendChild(envelope);
- Element dearSir = doc.createElementNS
+ Element dearSir = doc.createElementNS
("http://example.org/usps", "DearSir");
dearSir.appendChild(doc.createTextNode("foo"));
envelope.appendChild(dearSir);
Element body = doc.createElementNS("http://example.org/usps", "Body");
body.appendChild(doc.createTextNode("bar"));
envelope.appendChild(body);
- Element ys = doc.createElementNS
+ Element ys = doc.createElementNS
("http://example.org/usps", "YoursSincerely");
envelope.appendChild(ys);
@@ -579,7 +579,7 @@ public class CreateBaltimore23Test exten
// DOM L2 does not support the creation of DOCTYPEs, so instead
// we insert it before the document using a StringWriter
- // String docType =
+ // String docType =
// "<!DOCTYPE Envelope [\n"
// + "<!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>\n"
// + "<!ENTITY c14n 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'>\n"
@@ -608,7 +608,7 @@ public class CreateBaltimore23Test exten
DOMValidateContext dvc = new DOMValidateContext
(new X509KeySelector(ks), sigElement);
File f = new File(
- System.getProperty("dir.test.vector.baltimore") +
+ System.getProperty("dir.test.vector.baltimore") +
System.getProperty("file.separator") +
"merlin-xmldsig-twenty-three" +
System.getProperty("file.separator"));
@@ -616,11 +616,11 @@ public class CreateBaltimore23Test exten
dvc.setURIDereferencer(ud);
// register Notaries ID
- // Element notariesElem =
+ // Element notariesElem =
// (Element) doc.getElementsByTagName("Notaries").item(0);
// dvc.setIdAttributeNS(notariesElem, "", "Id");
// notariesElem.setIdAttributeNS("", "Id", true);
-
+
XMLSignature sig2 = fac.unmarshalXMLSignature(dvc);
assertTrue(sig.equals(sig2));
@@ -642,9 +642,9 @@ public class CreateBaltimore23Test exten
Reference ref;
if (b64) {
ref = fac.newReference
- ("http://www.w3.org/Signature/2002/04/xml-stylesheet.b64",
+ ("http://www.w3.org/Signature/2002/04/xml-stylesheet.b64",
sha1, Collections.singletonList
- (fac.newTransform(Transform.BASE64,
+ (fac.newTransform(Transform.BASE64,
(TransformParameterSpec) null)), null, null);
} else {
ref = fac.newReference
@@ -652,7 +652,7 @@ public class CreateBaltimore23Test exten
}
// create SignedInfo
- SignedInfo si = fac.newSignedInfo(withoutComments, sm,
+ SignedInfo si = fac.newSignedInfo(withoutComments, sm,
Collections.singletonList(ref));
Document doc = db.newDocument();
@@ -681,9 +681,9 @@ public class CreateBaltimore23Test exten
base + fs + "src/test/resources" + fs + "ie" + fs +
"baltimore" + fs + "merlin-examples" + fs +
"merlin-xmldsig-twenty-three" + fs);
- dvc.setBaseURI(f.toURI().toString());
+ dvc.setBaseURI(f.toURI().toString());
dvc.setURIDereferencer(ud);
-
+
XMLSignature sig2 = fac.unmarshalXMLSignature(dvc);
assertTrue(sig.equals(sig2));
@@ -691,27 +691,27 @@ public class CreateBaltimore23Test exten
}
private void test_create_signature_enveloping
- (SignatureMethod sm, KeyInfo ki, Key signingKey, KeySelector ks,
+ (SignatureMethod sm, KeyInfo ki, Key signingKey, KeySelector ks,
boolean b64) throws Exception {
// create reference
Reference ref;
if (b64) {
ref = fac.newReference("#object", sha1, Collections.singletonList
- (fac.newTransform(Transform.BASE64,
+ (fac.newTransform(Transform.BASE64,
(TransformParameterSpec) null)), null, null);
} else {
ref = fac.newReference("#object", sha1);
}
// create SignedInfo
- SignedInfo si = fac.newSignedInfo(withoutComments, sm,
+ SignedInfo si = fac.newSignedInfo(withoutComments, sm,
Collections.singletonList(ref));
Document doc = db.newDocument();
// create Objects
XMLObject obj = fac.newXMLObject(Collections.singletonList
- (new DOMStructure(doc.createTextNode("some text"))),
+ (new DOMStructure(doc.createTextNode("some text"))),
"object", null, null);
// create XMLSignature
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropExcC14NTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropExcC14NTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropExcC14NTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropExcC14NTest.java Tue Dec 15 17:13:17 2015
@@ -66,7 +66,7 @@ public class CreateInteropExcC14NTest ex
// get key & self-signed certificate from keystore
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
-
+
String fs = System.getProperty("file.separator");
FileInputStream fis = new FileInputStream
(base + fs + "src/test/resources" + fs + "test.jks");
@@ -83,10 +83,10 @@ public class CreateInteropExcC14NTest ex
// create reference 1
refs.add(fac.newReference
- ("#xpointer(id('to-be-signed'))",
+ ("#xpointer(id('to-be-signed'))",
fac.newDigestMethod(DigestMethod.SHA1, null),
Collections.singletonList
- (fac.newTransform(CanonicalizationMethod.EXCLUSIVE,
+ (fac.newTransform(CanonicalizationMethod.EXCLUSIVE,
(TransformParameterSpec) null)),
null, null));
@@ -96,7 +96,7 @@ public class CreateInteropExcC14NTest ex
prefixList.add("#default");
ExcC14NParameterSpec params = new ExcC14NParameterSpec(prefixList);
refs.add(fac.newReference
- ("#xpointer(id('to-be-signed'))",
+ ("#xpointer(id('to-be-signed'))",
fac.newDigestMethod(DigestMethod.SHA1, null),
Collections.singletonList
(fac.newTransform(CanonicalizationMethod.EXCLUSIVE, params)),
@@ -104,10 +104,10 @@ public class CreateInteropExcC14NTest ex
// create reference 3
refs.add(fac.newReference
- ("#xpointer(id('to-be-signed'))",
+ ("#xpointer(id('to-be-signed'))",
fac.newDigestMethod(DigestMethod.SHA1, null),
Collections.singletonList(fac.newTransform
- (CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS,
+ (CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS,
(TransformParameterSpec) null)),
null, null));
@@ -117,17 +117,17 @@ public class CreateInteropExcC14NTest ex
prefixList.add("#default");
params = new ExcC14NParameterSpec(prefixList);
refs.add(fac.newReference
- ("#xpointer(id('to-be-signed'))",
+ ("#xpointer(id('to-be-signed'))",
fac.newDigestMethod(DigestMethod.SHA1, null),
Collections.singletonList(fac.newTransform
- (CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS,
+ (CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS,
params)),
null, null));
// create SignedInfo
SignedInfo si = fac.newSignedInfo(
fac.newCanonicalizationMethod
- (CanonicalizationMethod.EXCLUSIVE,
+ (CanonicalizationMethod.EXCLUSIVE,
(C14NMethodParameterSpec) null),
fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null), refs);
@@ -159,7 +159,7 @@ public class CreateInteropExcC14NTest ex
sig.sign(dsc);
TestUtils.validateSecurityOrEncryptionElement(foo.getLastChild());
-
+
DOMValidateContext dvc = new DOMValidateContext
(new KeySelectors.KeyValueKeySelector(), foo.getLastChild());
XMLSignature sig2 = fac.unmarshalXMLSignature(dvc);
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXFilter2Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXFilter2Test.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXFilter2Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXFilter2Test.java Tue Dec 15 17:13:17 2015
@@ -68,7 +68,7 @@ public class CreateInteropXFilter2Test e
// get key & self-signed certificate from keystore
String fs = System.getProperty("file.separator");
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
-
+
FileInputStream fis = new FileInputStream
(base + fs + "src/test/resources" + fs + "test.jks");
ks = KeyStore.getInstance("JKS");
@@ -98,19 +98,19 @@ public class CreateInteropXFilter2Test e
// create reference 2
List<Transform> trans2 = new ArrayList<Transform>(2);
- trans2.add(fac.newTransform(Transform.ENVELOPED,
+ trans2.add(fac.newTransform(Transform.ENVELOPED,
(TransformParameterSpec) null));
XPathFilter2ParameterSpec xp2 = new XPathFilter2ParameterSpec
(Collections.singletonList
(new XPathType(" / ", XPathType.Filter.UNION)));
trans2.add(fac.newTransform(Transform.XPATH2, xp2));
- refs.add(fac.newReference("#signature-value",
+ refs.add(fac.newReference("#signature-value",
fac.newDigestMethod(DigestMethod.SHA1, null), trans2, null, null));
-
+
// create SignedInfo
SignedInfo si = fac.newSignedInfo(
fac.newCanonicalizationMethod
- (CanonicalizationMethod.INCLUSIVE,
+ (CanonicalizationMethod.INCLUSIVE,
(C14NMethodParameterSpec) null),
fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null), refs);
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXMLDSig11Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXMLDSig11Test.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXMLDSig11Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreateInteropXMLDSig11Test.java Tue Dec 15 17:13:17 2015
@@ -281,7 +281,7 @@ public class CreateInteropXMLDSig11Test
TestUtils.getSecretKey
("testkey".getBytes("ASCII")), sks);
}
-
+
private void test_create_signature_enveloping(
SignatureMethod sm, DigestMethod dm, KeyInfo ki, Key signingKey, KeySelector ks
) throws Exception {
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreatePhaosXMLDSig3Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreatePhaosXMLDSig3Test.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreatePhaosXMLDSig3Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/CreatePhaosXMLDSig3Test.java Tue Dec 15 17:13:17 2015
@@ -61,10 +61,10 @@ public class CreatePhaosXMLDSig3Test ext
@org.junit.Test
public void test_create_hmac_sha1_exclusive_c14n_comments_detached() throws Exception {
test_create_hmac_sha1_exclusive_c14n_comments_detached(false);
- }
+ }
@org.junit.Test
- public void test_create_hmac_sha1_40_exclusive_c14n_comments_detached()
+ public void test_create_hmac_sha1_40_exclusive_c14n_comments_detached()
throws Exception {
try {
test_create_hmac_sha1_exclusive_c14n_comments_detached(true);
@@ -73,9 +73,9 @@ public class CreatePhaosXMLDSig3Test ext
System.out.println(xse.getMessage());
// pass
}
- }
+ }
- private void test_create_hmac_sha1_exclusive_c14n_comments_detached(boolean fortyBit)
+ private void test_create_hmac_sha1_exclusive_c14n_comments_detached(boolean fortyBit)
throws Exception {
// create reference
@@ -88,12 +88,12 @@ public class CreatePhaosXMLDSig3Test ext
if (fortyBit) {
spec = new HMACParameterSpec(40);
}
-
+
SignedInfo si = fac.newSignedInfo(
fac.newCanonicalizationMethod
- (CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS,
+ (CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS,
(C14NMethodParameterSpec) null),
- fac.newSignatureMethod(SignatureMethod.HMAC_SHA1, spec),
+ fac.newSignatureMethod(SignatureMethod.HMAC_SHA1, spec),
Collections.singletonList(ref));
// create XMLSignature
@@ -128,15 +128,15 @@ public class CreatePhaosXMLDSig3Test ext
// create reference
Reference ref = fac.newReference("",
fac.newDigestMethod(DigestMethod.SHA1, null),
- Collections.singletonList(fac.newTransform(Transform.ENVELOPED,
+ Collections.singletonList(fac.newTransform(Transform.ENVELOPED,
(TransformParameterSpec) null)),
null, null);
// create SignedInfo
SignedInfo si = fac.newSignedInfo(
- fac.newCanonicalizationMethod(CanonicalizationMethod.EXCLUSIVE,
+ fac.newCanonicalizationMethod(CanonicalizationMethod.EXCLUSIVE,
(C14NMethodParameterSpec) null),
- fac.newSignatureMethod(SignatureMethod.HMAC_SHA1, null),
+ fac.newSignatureMethod(SignatureMethod.HMAC_SHA1, null),
Collections.singletonList(ref));
// create XMLSignature
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DetachedTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DetachedTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DetachedTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DetachedTest.java Tue Dec 15 17:13:17 2015
@@ -35,8 +35,8 @@ import org.apache.xml.security.utils.XML
import org.w3c.dom.Document;
/**
- * This is a simple example of generating and validating a Detached XML
- * Signature using the JSR 105 API. The resulting signature will look
+ * This is a simple example of generating and validating a Detached XML
+ * Signature using the JSR 105 API. The resulting signature will look
* like (key and signature values will be different):
*
* <pre><code>
@@ -90,48 +90,48 @@ public class DetachedTest extends org.ju
public DetachedTest() {
//
}
-
+
@org.junit.Test
public void test() {
try {
//
// PART 1 : Creating the detached signature
//
-
- // Create a factory that will be used to generate the signature
+
+ // Create a factory that will be used to generate the signature
// structures
XMLSignatureFactory fac = XMLSignatureFactory.getInstance
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
-
+
// Create a Reference to an external URI that will be digested
Reference ref = fac.newReference
- ("http://www.w3.org/TR/xml-stylesheet",
+ ("http://www.w3.org/TR/xml-stylesheet",
fac.newDigestMethod(DigestMethod.SHA1, null));
-
+
// Create a DSA KeyPair
KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
- kpg.initialize(1024,
+ kpg.initialize(1024,
new SecureRandom("not so random bytes".getBytes()));
KeyPair kp = kpg.generateKeyPair();
-
+
// Create a KeyValue containing the generated DSA PublicKey
KeyInfoFactory kif = fac.getKeyInfoFactory();
KeyValue kv = kif.newKeyValue(kp.getPublic());
-
+
// Create a KeyInfo and add the KeyValue to it
KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));
// Create SignedInfo
SignedInfo si = fac.newSignedInfo(fac.newCanonicalizationMethod(
- CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
- (C14NMethodParameterSpec) null),
- fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null),
+ CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
+ (C14NMethodParameterSpec) null),
+ fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null),
Collections.singletonList(ref));
// Create XMLSignature
XMLSignature signature = fac.newXMLSignature(si,ki,null,null,null);
-
- // Create an XMLSignContext and set the
+
+ // Create an XMLSignContext and set the
// DSA PrivateKey for signing
Document doc = XMLUtils.createDocumentBuilder(false).newDocument();
DOMSignContext signContext = new DOMSignContext(kp.getPrivate(), doc);
@@ -143,19 +143,19 @@ public class DetachedTest extends org.ju
// Generate (and sign) the XMLSignature
signature.sign(signContext);
TestUtils.validateSecurityOrEncryptionElement(doc.getDocumentElement());
-
+
//
// PART 2 : Validating the detached signature
//
-
+
// Create a XMLValidateContext & set the DSAPublicKey for validating
XMLValidateContext vc = new DOMValidateContext(kp.getPublic(),
doc.getDocumentElement());
vc.setURIDereferencer(ud);
-
+
// Validate the Signature (generated above)
- boolean coreValidity = signature.validate(vc);
-
+ boolean coreValidity = signature.validate(vc);
+
// Check core validation status
if (coreValidity == false) {
// check the validation status of each Reference
@@ -167,7 +167,7 @@ public class DetachedTest extends org.ju
}
fail("Signature failed core validation");
}
-
+
// You can also validate an XML Signature which is in XML format.
// Unmarshal and validate an XMLSignature from a DOMValidateContext
signature = fac.unmarshalXMLSignature(vc);
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DigestMethodTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DigestMethodTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DigestMethodTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/DigestMethodTest.java Tue Dec 15 17:13:17 2015
@@ -49,8 +49,8 @@ public class DigestMethodTest extends or
String algo = MD_ALGOS[i];
dm = factory.newDigestMethod(algo, null);
try {
- dm.isFeatureSupported(null);
- fail("Should raise a NPE for null feature");
+ dm.isFeatureSupported(null);
+ fail("Should raise a NPE for null feature");
} catch (NullPointerException npe) {}
assertTrue(!dm.isFeatureSupported("not supported"));
}
@@ -69,9 +69,9 @@ public class DigestMethodTest extends or
assertNull(dm.getParameterSpec());
try {
- dm = factory.newDigestMethod(algo,
+ dm = factory.newDigestMethod(algo,
new TestUtils.MyOwnDigestMethodParameterSpec());
- fail("Should raise an IAPE for invalid parameters");
+ fail("Should raise an IAPE for invalid parameters");
} catch (InvalidAlgorithmParameterException iape) {
} catch (Exception ex) {
fail("Should raise an IAPE instead of " + ex);
@@ -79,17 +79,17 @@ public class DigestMethodTest extends or
}
try {
- dm = factory.newDigestMethod("non-existent",
- null);
- fail("Should raise an NSAE for non-existent algos");
+ dm = factory.newDigestMethod("non-existent",
+ null);
+ fail("Should raise an NSAE for non-existent algos");
} catch (NoSuchAlgorithmException nsae) {}
try {
- dm = factory.newDigestMethod(null, null);
- fail("Should raise a NPE for null algo");
+ dm = factory.newDigestMethod(null, null);
+ fail("Should raise a NPE for null algo");
} catch (NullPointerException npe) {
//
}
- }
-
+ }
+
}
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Driver.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Driver.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Driver.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/Driver.java Tue Dec 15 17:13:17 2015
@@ -26,8 +26,8 @@ import javax.xml.crypto.dsig.spec.C14NMe
* Used by ClassLoaderTest
*/
public class Driver {
-
- private static org.slf4j.Logger log =
+
+ private static org.slf4j.Logger log =
org.slf4j.LoggerFactory.getLogger(Driver.class);
public void dsig() throws Exception {
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/HMACSignatureAlgorithmTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/HMACSignatureAlgorithmTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/HMACSignatureAlgorithmTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/HMACSignatureAlgorithmTest.java Tue Dec 15 17:13:17 2015
@@ -66,7 +66,7 @@ public class HMACSignatureAlgorithmTest
public HMACSignatureAlgorithmTest() 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,23 +83,23 @@ public class HMACSignatureAlgorithmTest
bcInstalled = true;
}
}
-
+
db = XMLUtils.createDocumentBuilder(false);
// create common objects
fac = XMLSignatureFactory.getInstance("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
withoutComments = fac.newCanonicalizationMethod
(CanonicalizationMethod.INCLUSIVE, (C14NMethodParameterSpec) null);
-
+
// Digest Methods
sha1 = fac.newDigestMethod(DigestMethod.SHA1, null);
-
+
hmacSha1 = fac.newSignatureMethod("http://www.w3.org/2000/09/xmldsig#hmac-sha1", null);
hmacSha224 = fac.newSignatureMethod("http://www.w3.org/2001/04/xmldsig-more#hmac-sha224", null);
hmacSha256 = fac.newSignatureMethod("http://www.w3.org/2001/04/xmldsig-more#hmac-sha256", null);
hmacSha384 = fac.newSignatureMethod("http://www.w3.org/2001/04/xmldsig-more#hmac-sha384", null);
hmacSha512 = fac.newSignatureMethod("http://www.w3.org/2001/04/xmldsig-more#hmac-sha512", null);
ripemd160 = fac.newSignatureMethod("http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160", null);
-
+
sks = new KeySelectors.SecretKeySelector("testkey".getBytes("ASCII"));
}
@@ -113,31 +113,31 @@ public class HMACSignatureAlgorithmTest
test_create_signature_enveloping(hmacSha1, sha1, null,
TestUtils.getSecretKey("testkey".getBytes("ASCII")), sks);
}
-
+
@org.junit.Test
public void testHMACSHA_224() throws Exception {
test_create_signature_enveloping(hmacSha224, sha1, null,
TestUtils.getSecretKey("testkey".getBytes("ASCII")), sks);
}
-
+
@org.junit.Test
public void testHMACSHA_256() throws Exception {
test_create_signature_enveloping(hmacSha256, sha1, null,
TestUtils.getSecretKey("testkey".getBytes("ASCII")), sks);
}
-
+
@org.junit.Test
public void testHMACSHA_384() throws Exception {
test_create_signature_enveloping(hmacSha384, sha1, null,
TestUtils.getSecretKey("testkey".getBytes("ASCII")), sks);
}
-
+
@org.junit.Test
public void testHMACSHA_512() throws Exception {
test_create_signature_enveloping(hmacSha512, sha1, null,
TestUtils.getSecretKey("testkey".getBytes("ASCII")), sks);
}
-
+
@org.junit.Test
public void testHMACRIPEMD160() throws Exception {
if (!bcInstalled) {
@@ -146,7 +146,7 @@ public class HMACSignatureAlgorithmTest
test_create_signature_enveloping(ripemd160, sha1, null,
TestUtils.getSecretKey("testkey".getBytes("ASCII")), sks);
}
-
+
private void test_create_signature_enveloping(
SignatureMethod sm, DigestMethod dm, KeyInfo ki, Key signingKey, KeySelector ks
) throws Exception {
@@ -176,7 +176,7 @@ public class HMACSignatureAlgorithmTest
sig.sign(dsc);
TestUtils.validateSecurityOrEncryptionElement(doc.getDocumentElement());
-
+
// XMLUtils.outputDOM(doc.getDocumentElement(), System.out);
DOMValidateContext dvc = new DOMValidateContext
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikCoreFeaturesTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikCoreFeaturesTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikCoreFeaturesTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikCoreFeaturesTest.java Tue Dec 15 17:13:17 2015
@@ -30,7 +30,7 @@ import javax.xml.crypto.dsig.XMLSignatur
import javax.xml.crypto.test.KeySelectors;
/**
- * This is a testcase to validate all "coreFeatures"
+ * This is a testcase to validate all "coreFeatures"
* testcases from IAIK
*
* @author Sean Mullan
@@ -53,17 +53,17 @@ public class IaikCoreFeaturesTest extend
validator = new SignatureValidator(new File
(base, "coreFeatures/signatures"));
}
-
+
@org.junit.Test
public void test_anonymousReferenceSignature() throws Exception {
String file = "anonymousReferenceSignature.xml";
boolean coreValidity = validator.validate
- (file, new KeySelectors.KeyValueKeySelector(),
+ (file, new KeySelectors.KeyValueKeySelector(),
new NullURIDereferencer(base));
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_manifestSignature() throws Exception {
String file = "manifestSignature.xml";
@@ -72,7 +72,7 @@ public class IaikCoreFeaturesTest extend
(file, new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_signatureTypesSignature() throws Exception {
String file = "signatureTypesSignature.xml";
@@ -82,7 +82,7 @@ public class IaikCoreFeaturesTest extend
new OfflineDereferencer());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
private static class NullURIDereferencer implements URIDereferencer {
private OctetStreamData osd;
@@ -93,7 +93,7 @@ public class IaikCoreFeaturesTest extend
osd = new OctetStreamData(new FileInputStream(content));
}
- public Data dereference(URIReference uriReference,
+ public Data dereference(URIReference uriReference,
XMLCryptoContext context) throws URIReferenceException {
if (uriReference.getURI() != null) {
@@ -103,22 +103,22 @@ public class IaikCoreFeaturesTest extend
return osd;
}
}
-
+
private static class OfflineDereferencer implements URIDereferencer {
private String w3cRec;
private URIDereferencer defaultDereferencer;
OfflineDereferencer() throws Exception {
String fs = System.getProperty("file.separator");
- String base = System.getProperty("basedir") == null ? "./" :
+ String base = System.getProperty("basedir") == null ? "./" :
System.getProperty("basedir");
- w3cRec = base + fs + "src/test/resources" + fs + "org" + fs + "w3c" + fs + "www" +
+ w3cRec = base + fs + "src/test/resources" + fs + "org" + fs + "w3c" + fs + "www" +
fs + "TR" + fs + "2000";
defaultDereferencer =
XMLSignatureFactory.getInstance().getURIDereferencer();
}
- public Data dereference(URIReference uriReference,
+ public Data dereference(URIReference uriReference,
XMLCryptoContext context) throws URIReferenceException {
try {
@@ -133,5 +133,5 @@ public class IaikCoreFeaturesTest extend
}
}
}
-
+
}
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikSignatureAlgosTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikSignatureAlgosTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikSignatureAlgosTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikSignatureAlgosTest.java Tue Dec 15 17:13:17 2015
@@ -28,7 +28,7 @@ import javax.xml.crypto.dsig.XMLSignatur
import javax.xml.crypto.test.KeySelectors;
/**
- * This is a testcase to validate all "signatureAlgorithms"
+ * This is a testcase to validate all "signatureAlgorithms"
* testcases from IAIK
*
* @author Sean Mullan
@@ -50,31 +50,31 @@ public class IaikSignatureAlgosTest exte
validator = new SignatureValidator(new File
(base, "signatureAlgorithms/signatures"));
}
-
+
@org.junit.Test
public void test_dsaSignature() throws Exception {
String file = "dSASignature.xml";
- boolean coreValidity = validator.validate(file, new
+ boolean coreValidity = validator.validate(file, new
KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_rsaSignature() throws Exception {
String file = "rSASignature.xml";
- boolean coreValidity = validator.validate(file, new
+ boolean coreValidity = validator.validate(file, new
KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_hmacShortSignature() throws Exception {
String file = "hMACShortSignature.xml";
try {
- validator.validate(file, new
+ validator.validate(file, new
KeySelectors.SecretKeySelector("secret".getBytes("ASCII")));
fail("Expected HMACOutputLength Exception");
} catch (XMLSignatureException xse) {
@@ -82,7 +82,7 @@ public class IaikSignatureAlgosTest exte
// pass
}
}
-
+
@org.junit.Test
public void test_hmacSignature() throws Exception {
String file = "hMACSignature.xml";
@@ -91,5 +91,5 @@ public class IaikSignatureAlgosTest exte
KeySelectors.SecretKeySelector("secret".getBytes("ASCII")));
assertTrue("Signature failed core validation", coreValidity);
}
-
+
}
Modified: santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikTransformsTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikTransformsTest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikTransformsTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/javax/xml/crypto/test/dsig/IaikTransformsTest.java Tue Dec 15 17:13:17 2015
@@ -27,7 +27,7 @@ import java.security.Security;
import javax.xml.crypto.test.KeySelectors;
/**
- * This is a testcase to validate all "transforms"
+ * This is a testcase to validate all "transforms"
* testcases from IAIK
*
* @author Sean Mullan
@@ -49,7 +49,7 @@ public class IaikTransformsTest extends
validator = new SignatureValidator(new File
(base, "transforms/signatures"));
}
-
+
@org.junit.Test
public void test_base64DecodeSignature() throws Exception {
String file = "base64DecodeSignature.xml";
@@ -59,7 +59,7 @@ public class IaikTransformsTest extends
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_envelopedSignatureSignature() throws Exception {
String file = "envelopedSignatureSignature.xml";
@@ -68,7 +68,7 @@ public class IaikTransformsTest extends
(file, new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_c14nSignature() throws Exception {
String file = "c14nSignature.xml";
@@ -77,7 +77,7 @@ public class IaikTransformsTest extends
(file, new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
@org.junit.Test
public void test_xPathSignature() throws Exception {
String file = "xPathSignature.xml";
@@ -86,5 +86,5 @@ public class IaikTransformsTest extends
(file, new KeySelectors.KeyValueKeySelector());
assertTrue("Signature failed core validation", coreValidity);
}
-
+
}