Package org.apache.cxf.xkms.x509.validator

Examples of org.apache.cxf.xkms.x509.validator.DateValidatorTest


    private static final LdapSchemaConfig LDAP_CERT_CONFIG = new LdapSchemaConfig();

    @Test
    @Ignore
    public void testFindUserCert() throws URISyntaxException, NamingException, CertificateException {
        CertificateRepo persistenceManager = createLdapCertificateRepo();
        testFindBySubjectDnInternal(persistenceManager);
    }
View Full Code Here


    }

    @Test
    @Ignore
    public void testFindUserCertForNonExistantDn() throws URISyntaxException, NamingException, CertificateException {
        CertificateRepo persistenceManager = createLdapCertificateRepo();
        X509Certificate cert = persistenceManager.findBySubjectDn("CN=wrong");
        Assert.assertNull("Certifiacte should be null", cert);
    }
View Full Code Here

    }

    @Test
    @Ignore
    public void testFindServiceCert() throws URISyntaxException, NamingException, CertificateException {
        CertificateRepo persistenceManager = createLdapCertificateRepo();
        String serviceUri = "cn=http:\\/\\/myservice.apache.org\\/MyServiceName,ou=services";
        X509Certificate cert = persistenceManager.findByServiceName(serviceUri);
        Assert.assertEquals(EXPECTED_SUBJECT_DN, cert.getSubjectDN().toString());
    }
View Full Code Here

    }

    @Test
    @Ignore
    public void testSave() throws Exception {
        CertificateRepo persistenceManager = createLdapCertificateRepo();
        File certFile = new File("src/test/java/cert1.cer");
        Assert.assertTrue(certFile.exists());
        FileInputStream fis = new FileInputStream(certFile);
        CertificateFactory factory = CertificateFactory.getInstance("X.509");
        X509Certificate cert = (X509Certificate) factory.generateCertificate(fis);

        UseKeyWithType key = new UseKeyWithType();
        key.setApplication(Applications.PKIX.getUri());
        key.setIdentifier(EXPECTED_SUBJECT_DN);
        persistenceManager.saveCertificate(cert, key);
        testFindBySubjectDnInternal(persistenceManager);
    }
View Full Code Here

    private static final LdapSchemaConfig LDAP_CERT_CONFIG = new LdapSchemaConfig();

    @Test
    @Ignore
    public void testFindUserCert() throws URISyntaxException, NamingException, CertificateException {
        CertificateRepo persistenceManager = createLdapCertificateRepo();
        testFindBySubjectDnInternal(persistenceManager);
    }
View Full Code Here

    }

    @Test
    @Ignore
    public void testFindUserCertForNonExistantDn() throws URISyntaxException, NamingException, CertificateException {
        CertificateRepo persistenceManager = createLdapCertificateRepo();
        X509Certificate cert = persistenceManager.findBySubjectDn("CN=wrong");
        Assert.assertNull("Certifiacte should be null", cert);
    }
View Full Code Here

    }

    @Test
    @Ignore
    public void testFindServiceCert() throws URISyntaxException, NamingException, CertificateException {
        CertificateRepo persistenceManager = createLdapCertificateRepo();
        String serviceUri = "cn=http:\\/\\/myservice.apache.org\\/MyServiceName,ou=services";
        X509Certificate cert = persistenceManager.findByServiceName(serviceUri);
        Assert.assertEquals(EXPECTED_SUBJECT_DN, cert.getSubjectDN().toString());
    }
View Full Code Here

    }

    @Test
    @Ignore
    public void testSave() throws Exception {
        CertificateRepo persistenceManager = createLdapCertificateRepo();
        File certFile = new File("src/test/java/cert1.cer");
        Assert.assertTrue(certFile.exists());
        FileInputStream fis = new FileInputStream(certFile);
        CertificateFactory factory = CertificateFactory.getInstance("X.509");
        X509Certificate cert = (X509Certificate) factory.generateCertificate(fis);

        UseKeyWithType key = new UseKeyWithType();
        key.setApplication(Applications.PKIX.getUri());
        key.setIdentifier(EXPECTED_SUBJECT_DN);
        persistenceManager.saveCertificate(cert, key);
        testFindBySubjectDnInternal(persistenceManager);
    }
View Full Code Here

    private static final org.apache.cxf.xkms.model.xkms.ObjectFactory XKMS_OF =
        new org.apache.cxf.xkms.model.xkms.ObjectFactory();

    @Test
    public void locate() throws CertificateException {
        CertificateRepo certRepo = EasyMock.createMock(CertificateRepo.class);
        EasyMock.expect(certRepo.findBySubjectDn(EasyMock.eq("alice"))).andReturn(getAliceCert());
        EasyMock.replay(certRepo);
        X509Locator locator = new X509Locator(certRepo);
        LocateRequestType request = prepareLocateXKMSRequest();
        UnverifiedKeyBindingType result = locator.locate(request);
        Assert.assertNotNull(result.getKeyInfo());
View Full Code Here

    @Before
    public void setUpCertificateRepo() throws CertificateException {
        File storageDir = new File("target/teststore_trusted_authority_validator");
        FileUtils.removeDir(storageDir);
        storageDir.mkdirs();
        certificateRepo = new FileCertificateRepo("target/teststore_trusted_authority_validator");

        UseKeyWithType rootKey = new UseKeyWithType();
        rootKey.setApplication(Applications.PKIX.getUri());
        String subjectDN = certificateRoot.getSubjectX500Principal().getName();
        rootKey.setIdentifier(subjectDN);
View Full Code Here

TOP

Related Classes of org.apache.cxf.xkms.x509.validator.DateValidatorTest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.