Search in sources :

Example 31 with ResourceResolverSpi

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

the class RSASecurityTest method test_enveloped.

@org.junit.Test
public void test_enveloped() throws Exception {
    String filename = blakesDir + "certj201_enveloped.xml";
    boolean followManifests = false;
    ResourceResolverSpi resolver = null;
    boolean verify = this.verify(filename, resolver, followManifests);
    if (!verify) {
        LOG.error("Verification failed for " + filename);
    }
    assertTrue(filename, verify);
}
Also used : ResourceResolverSpi(org.apache.xml.security.utils.resolver.ResourceResolverSpi)

Example 32 with ResourceResolverSpi

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

the class IAIKTest method test_signatureAlgorithms_signatures_hMACSignature.

/**
 * Method test_signatureAlgorithms_signatures_hMACSignature
 *
 * @throws Exception
 */
@org.junit.Test
public void test_signatureAlgorithms_signatures_hMACSignature() throws Exception {
    String filename = gregorsDir + "signatureAlgorithms/signatures/hMACSignature.xml";
    ResourceResolverSpi resolver = new OfflineResolver();
    boolean followManifests = false;
    byte[] hmacKey = "secret".getBytes(StandardCharsets.US_ASCII);
    boolean verify = false;
    try {
        verify = this.verifyHMAC(filename, resolver, followManifests, hmacKey);
    } 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 33 with ResourceResolverSpi

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

the class IAIKTest method test_coreFeatures_signatures_manifestSignature_core.

/**
 * Method test_coreFeatures_signatures_manifestSignature
 *
 * @throws Exception
 */
@org.junit.Test
public void test_coreFeatures_signatures_manifestSignature_core() throws Exception {
    String filename = gregorsDir + "coreFeatures/signatures/manifestSignature.xml";
    ResourceResolverSpi resolver = null;
    boolean followManifests = false;
    boolean verify = false;
    try {
        verify = this.verify(filename, resolver, followManifests);
    } catch (RuntimeException ex) {
        LOG.error("Core validation crashed for " + filename);
        throw ex;
    }
    if (!verify) {
        LOG.error("Core validation failed for " + filename);
    }
    assertTrue("Core validation failed for " + filename, verify);
}
Also used : ResourceResolverSpi(org.apache.xml.security.utils.resolver.ResourceResolverSpi)

Example 34 with ResourceResolverSpi

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

the class IAIKTest method test_coreFeatures_signatures_signatureTypesSignature.

/**
 * Method test_coreFeatures_signatures_signatureTypesSignature
 *
 * @throws Exception
 */
@org.junit.Test
public void test_coreFeatures_signatures_signatureTypesSignature() throws Exception {
    String filename = gregorsDir + "coreFeatures/signatures/signatureTypesSignature.xml";
    ResourceResolverSpi resolver = new OfflineResolver();
    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("Verification failed for " + filename, verify);
}
Also used : ResourceResolverSpi(org.apache.xml.security.utils.resolver.ResourceResolverSpi) OfflineResolver(org.apache.xml.security.test.dom.utils.resolver.OfflineResolver)

Example 35 with ResourceResolverSpi

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

the class IAIKTest method test_coreFeatures_signatures_anonymousReferenceSignature.

/**
 * Method test_coreFeatures_signatures_anonymousReferenceSignature
 *
 * @throws Exception
 */
@org.junit.Test
public void test_coreFeatures_signatures_anonymousReferenceSignature() throws Exception {
    String filename = gregorsDir + "coreFeatures/signatures/anonymousReferenceSignature.xml";
    String anonymousRef = gregorsDir + "coreFeatures/samples/anonymousReferenceContent.xml";
    ResourceResolverSpi resolver = new ResolverAnonymous(anonymousRef);
    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) ResolverAnonymous(org.apache.xml.security.utils.resolver.implementations.ResolverAnonymous)

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