Search in sources :

Example 6 with ResourceResolverSpi

use of org.apache.xml.security.utils.resolver.ResourceResolverSpi in project santuario-java by apache.

the class BaltimoreTest method test_fifteen_enveloping_b64_dsa.

/**
 * Method test_fifteen_enveloping_b64_dsa
 *
 * @throws Exception
 */
@org.junit.Test
public void test_fifteen_enveloping_b64_dsa() throws Exception {
    String filename = merlinsDir15 + "signature-enveloping-b64-dsa.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);
}
Also used : ResourceResolverSpi(org.apache.xml.security.utils.resolver.ResourceResolverSpi)

Example 7 with ResourceResolverSpi

use of org.apache.xml.security.utils.resolver.ResourceResolverSpi in project santuario-java by apache.

the class BaltimoreTest method test_twenty_three_enveloping_b64_dsa.

/**
 * Method test_twenty_three_enveloping_b64_dsa
 *
 * @throws Exception
 */
@org.junit.Test
public void test_twenty_three_enveloping_b64_dsa() throws Exception {
    String filename = merlinsDir23 + "signature-enveloping-b64-dsa.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);
}
Also used : ResourceResolverSpi(org.apache.xml.security.utils.resolver.ResourceResolverSpi)

Example 8 with ResourceResolverSpi

use of org.apache.xml.security.utils.resolver.ResourceResolverSpi in project santuario-java by apache.

the class BaltimoreTest method test_twenty_three_external_b64_dsa.

/**
 * Method test_twenty_three_external_b64_dsa
 *
 * @throws Exception
 */
@org.junit.Test
public void test_twenty_three_external_b64_dsa() throws Exception {
    String filename = merlinsDir23 + "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);
}
Also used : ResourceResolverSpi(org.apache.xml.security.utils.resolver.ResourceResolverSpi) OfflineResolver(org.apache.xml.security.test.dom.utils.resolver.OfflineResolver)

Example 9 with ResourceResolverSpi

use of org.apache.xml.security.utils.resolver.ResourceResolverSpi in project santuario-java by apache.

the class BaltimoreTest method test_sixteen_bad_signature.

/**
 * Method test_sixteen_bad_signature. This tests make sure that an
 * invalid signature is not valid. This is validating merlin's 16
 * signature but some of the referenced content has been modified so
 * some of the references should be invalid.
 *
 * @throws Exception
 */
@org.junit.Test
public void test_sixteen_bad_signature() throws Exception {
    String filename = merlinsDir16 + "/bad-signature.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 passed (should have failed) for " + filename);
    }
    assertFalse(filename, verify);
}
Also used : ResourceResolverSpi(org.apache.xml.security.utils.resolver.ResourceResolverSpi) OfflineResolver(org.apache.xml.security.test.dom.utils.resolver.OfflineResolver)

Example 10 with ResourceResolverSpi

use of org.apache.xml.security.utils.resolver.ResourceResolverSpi in project santuario-java by apache.

the class BaltimoreTest method test_twenty_three_external_dsa_2.

/**
 * Method test_twenty_three_external_dsa_2
 *
 * @throws Exception
 */
@org.junit.Test
public void test_twenty_three_external_dsa_2() throws Exception {
    String filename = merlinsDir23 + "signature.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);
}
Also used : ResourceResolverSpi(org.apache.xml.security.utils.resolver.ResourceResolverSpi) OfflineResolver(org.apache.xml.security.test.dom.utils.resolver.OfflineResolver)

Aggregations

ResourceResolverSpi (org.apache.xml.security.utils.resolver.ResourceResolverSpi)39 OfflineResolver (org.apache.xml.security.test.dom.utils.resolver.OfflineResolver)21 XMLSignatureException (org.apache.xml.security.signature.XMLSignatureException)3 File (java.io.File)1 ResolverAnonymous (org.apache.xml.security.utils.resolver.implementations.ResolverAnonymous)1