use of org.apache.xml.security.utils.resolver.ResourceResolverSpi in project santuario-java by apache.
the class IAIKTest method test_coreFeatures_signatures_manifestSignature_manifest.
/**
* Method test_coreFeatures_signatures_manifestSignature_manifest
*
* @throws Exception
*/
@org.junit.Test
public void test_coreFeatures_signatures_manifestSignature_manifest() throws Exception {
String filename = gregorsDir + "coreFeatures/signatures/manifestSignature.xml";
ResourceResolverSpi resolver = null;
boolean followManifests = true;
boolean verify = false;
try {
verify = this.verify(filename, resolver, followManifests, false);
} catch (RuntimeException ex) {
LOG.error("Verification crashed for " + filename);
throw ex;
}
if (!verify) {
LOG.error("Following the ds:Manifest failed for " + filename);
}
assertTrue("Following the ds:Manifest failed for " + filename, verify);
}
use of org.apache.xml.security.utils.resolver.ResourceResolverSpi in project santuario-java by apache.
the class IAIKTest method test_transforms_signatures_base64DecodeSignature.
/**
* Method test_transforms_signatures_base64DecodeSignature
*
* @throws Exception
*/
@org.junit.Test
public void test_transforms_signatures_base64DecodeSignature() throws Exception {
String filename = gregorsDir + "transforms/signatures/base64DecodeSignature.xml";
ResourceResolverSpi resolver = null;
boolean followManifests = false;
boolean verify = false;
try {
verify = this.verify(filename, resolver, followManifests, false);
} 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.utils.resolver.ResourceResolverSpi in project santuario-java by apache.
the class IAIKTest method test_signatureAlgorithms_signatures_hMACShortSignature.
/**
* Method test_signatureAlgorithms_signatures_hMACShortSignature
*
* @throws Exception
*/
@org.junit.Test
public void test_signatureAlgorithms_signatures_hMACShortSignature() throws Exception {
String filename = gregorsDir + "signatureAlgorithms/signatures/hMACShortSignature.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.utils.resolver.ResourceResolverSpi in project santuario-java by apache.
the class IAIKTest method test_signatureAlgorithms_signatures_dSASignature.
/**
* Method test_signatureAlgorithms_signatures_dSASignature
*
* @throws Exception
*/
@org.junit.Test
public void test_signatureAlgorithms_signatures_dSASignature() throws Exception {
String filename = gregorsDir + "signatureAlgorithms/signatures/dSASignature.xml";
ResourceResolverSpi resolver = null;
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);
}
Aggregations