use of org.apache.xml.security.test.dom.utils.resolver.OfflineResolver in project santuario-java by apache.
the class BaltimoreTest method test_fifteen_external_b64_dsa.
/**
* Method test_fifteen_external_b64_dsa
*
* @throws Exception
*/
@org.junit.Test
public void test_fifteen_external_b64_dsa() throws Exception {
String filename = merlinsDir15 + "signature-external-b64-dsa.xml";
ResourceResolverSpi resolver = new OfflineResolver();
boolean followManifests = false;
boolean verify = false;
try {
verify = this.verify(filename, resolver, followManifests);
} catch (RuntimeException ex) {
LOG.error("Verification crashed for " + filename);
throw ex;
}
if (!verify) {
LOG.error("Verification failed for " + filename);
}
assertTrue(filename, verify);
}
use of org.apache.xml.security.test.dom.utils.resolver.OfflineResolver in project santuario-java by apache.
the class BaltimoreTest method test_fifteen_enveloping_hmac_sha1.
/**
* Method test_fifteen_enveloping_hmac_sha1
*
* @throws Exception
*/
@org.junit.Test
public void test_fifteen_enveloping_hmac_sha1() throws Exception {
String filename = merlinsDir15 + "signature-enveloping-hmac-sha1.xml";
boolean verify = this.verifyHMAC(filename, new OfflineResolver(), false, "secret".getBytes(StandardCharsets.US_ASCII));
if (!verify) {
LOG.error("Verification failed for " + filename);
}
assertTrue(filename, verify);
}
use of org.apache.xml.security.test.dom.utils.resolver.OfflineResolver in project santuario-java by apache.
the class BaltimoreTest method test_twenty_three_enveloping_hmac_sha1.
/**
* Method test_twenty_three_enveloping_hmac_sha1
*
* @throws Exception
*/
@org.junit.Test
public void test_twenty_three_enveloping_hmac_sha1() throws Exception {
String filename = merlinsDir23 + "signature-enveloping-hmac-sha1.xml";
boolean verify = this.verifyHMAC(filename, new OfflineResolver(), false, "secret".getBytes(StandardCharsets.US_ASCII));
if (!verify) {
LOG.error("Verification failed for " + filename);
}
assertTrue(filename, verify);
}
use of org.apache.xml.security.test.dom.utils.resolver.OfflineResolver in project santuario-java by apache.
the class BaltimoreTest method test_fifteen_enveloping_hmac_sha1_40.
/**
* Method test_fifteen_enveloping_hmac_sha1_40
*
* @throws Exception
*/
@org.junit.Test
public void test_fifteen_enveloping_hmac_sha1_40() throws Exception {
String filename = merlinsDir15 + "signature-enveloping-hmac-sha1-40.xml";
ResourceResolverSpi resolver = new OfflineResolver();
boolean followManifests = false;
byte[] hmacKey = "secret".getBytes(StandardCharsets.US_ASCII);
try {
this.verifyHMAC(filename, resolver, followManifests, hmacKey);
fail("HMACOutputLength Exception not caught");
} catch (RuntimeException ex) {
LOG.error("Verification crashed for " + filename);
throw ex;
} catch (XMLSignatureException ex) {
if (!ex.getMsgID().equals("algorithms.HMACOutputLengthMin")) {
fail(ex.getMessage());
}
}
}
use of org.apache.xml.security.test.dom.utils.resolver.OfflineResolver in project santuario-java by apache.
the class BaltimoreTest method test_twenty_three_enveloping_hmac_sha1_40.
/**
* Method test_twenty_three_enveloping_hmac_sha1_40
*
* @throws Exception
*/
@org.junit.Test
public void test_twenty_three_enveloping_hmac_sha1_40() throws Exception {
String filename = merlinsDir23 + "signature-enveloping-hmac-sha1-40.xml";
ResourceResolverSpi resolver = new OfflineResolver();
boolean followManifests = false;
byte[] hmacKey = "secret".getBytes(StandardCharsets.US_ASCII);
try {
this.verifyHMAC(filename, resolver, followManifests, hmacKey);
fail("HMACOutputLength Exception not caught");
} catch (RuntimeException ex) {
LOG.error("Verification crashed for " + filename);
throw ex;
} catch (XMLSignatureException ex) {
if (!ex.getMsgID().equals("algorithms.HMACOutputLengthMin")) {
fail(ex.getMessage());
}
}
}
Aggregations