Package org.apache.cxf.configuration.security

Examples of org.apache.cxf.configuration.security.SSLClientPolicy


    @Test
    public void testWrongKeyPasswordPKCS12() throws Exception {

        String keyStoreStr = getPath("resources/celtix.p12");
        SSLClientPolicy sslClientPolicy = new SSLClientPolicy();
        sslClientPolicy.setKeystore(keyStoreStr);
        sslClientPolicy.setKeyPassword("celtixpasswrong");
        sslClientPolicy.setKeystorePassword("celtixpass");

        String trustStoreStr = getPath("resources/abigcompany_ca.pem");
        sslClientPolicy.setTrustStore(trustStoreStr);
        TestLogHandler handler = new TestLogHandler();
        HttpsURLConnectionFactory factory = createFactory(sslClientPolicy,
                                                          "https://dummyurl",
                                                          handler);
        factory.decorate(connection);
View Full Code Here


    }

    @Test
    public void testAllElementsHaveSetupMethod() throws Exception {
        SSLClientPolicy policy = new SSLClientPolicy();
        TestLogHandler handler = new TestLogHandler();
        HttpsURLConnectionFactory factory = createFactory(policy,
                                                          "https://dummyurl",
                                                          handler);
        assertTrue("A new element has been " + "added to SSLClientPolicy without a corresponding "
View Full Code Here

    @Test
    public void testSetAllData() throws Exception {
       
        String keyStoreStr = getPath("resources/defaultkeystore");
        SSLClientPolicy sslClientPolicy = new SSLClientPolicy();
        sslClientPolicy.setKeystore(keyStoreStr);
        sslClientPolicy.setKeystoreType("JKS");

        sslClientPolicy.setKeyPassword("defaultkeypass");
        sslClientPolicy.setKeystorePassword("defaultkeypass");
        sslClientPolicy.setTrustStoreType("JKS");
        //sslClientPolicy.setTrustStoreAlgorithm("JKS");
        sslClientPolicy.setSecureSocketProtocol("TLSv1");
        sslClientPolicy.setSessionCacheKey("Anything");
        sslClientPolicy.setSessionCaching(true);
        sslClientPolicy.setMaxChainLength(new Long(2));
        sslClientPolicy.setCertValidator("Anything");
        sslClientPolicy.setProxyHost("Anything");
        sslClientPolicy.setProxyPort(new Long(1234));
        for (int i = 0; i < EXPORT_CIPHERS.length; i++) {
            sslClientPolicy.getCiphersuites().add(EXPORT_CIPHERS[i]);
        }
        for (int i = 0; i < NON_EXPORT_CIPHERS.length; i++) {
            sslClientPolicy.getCiphersuites().add(NON_EXPORT_CIPHERS[i]);
        }
       
        String trustStoreStr = getPath("resources/defaulttruststore");
        sslClientPolicy.setTrustStore(trustStoreStr);
        TestLogHandler handler = new TestLogHandler();
        HttpsURLConnectionFactory factory = createFactory(sslClientPolicy,
                                                          "https://dummyurl",
                                                          handler);
View Full Code Here

   
    @Test
    public void testDefaultedCipherSuiteFilters() throws Exception {
       
        String keyStoreStr = getPath("resources/defaultkeystore");
        SSLClientPolicy sslClientPolicy = new SSLClientPolicy();
        sslClientPolicy.setKeystore(keyStoreStr);
        sslClientPolicy.setKeystoreType("JKS");

        sslClientPolicy.setKeyPassword("defaultkeypass");
        sslClientPolicy.setKeystorePassword("defaultkeypass");
        sslClientPolicy.setTrustStoreType("JKS");
        sslClientPolicy.setSecureSocketProtocol("TLSv1");

        String trustStoreStr = getPath("resources/defaulttruststore");
        sslClientPolicy.setTrustStore(trustStoreStr);
        TestLogHandler handler = new TestLogHandler();
        HttpsURLConnectionFactory factory = createFactory(sslClientPolicy,
                                                          "https://dummyurl",
                                                          handler);
View Full Code Here

   
    @Test
    public void testNonDefaultedCipherSuiteFilters() throws Exception {
       
        String keyStoreStr = getPath("resources/defaultkeystore");
        SSLClientPolicy sslClientPolicy = new SSLClientPolicy();
        sslClientPolicy.setKeystore(keyStoreStr);
        sslClientPolicy.setKeystoreType("JKS");

        sslClientPolicy.setKeyPassword("defaultkeypass");
        sslClientPolicy.setKeystorePassword("defaultkeypass");
        sslClientPolicy.setTrustStoreType("JKS");
        sslClientPolicy.setSecureSocketProtocol("TLSv1");

        // reverse default sense of include/exlcude
        FiltersType filters = new ObjectFactory().createFiltersType();
        for (int i = 0; i < NON_EXPORT_CIPHERS.length; i++) {
            filters.getInclude().add(NON_EXPORT_CIPHERS[i]);
        }
        for (int i = 0; i < EXPORT_CIPHERS.length; i++) {
            filters.getExclude().add(EXPORT_CIPHERS[i]);
        }
        sslClientPolicy.setCiphersuiteFilters(filters);
       
        String trustStoreStr = getPath("resources/defaulttruststore");
        sslClientPolicy.setTrustStore(trustStoreStr);
        TestLogHandler handler = new TestLogHandler();
        HttpsURLConnectionFactory factory = createFactory(sslClientPolicy,
                                                          "https://dummyurl",
                                                          handler);
View Full Code Here

    @Test
    public void testAllValidDataJKS() throws Exception {

        String keyStoreStr = getPath("resources/defaultkeystore");
        SSLClientPolicy sslClientPolicy = new SSLClientPolicy();
        sslClientPolicy.setKeystore(keyStoreStr);
        sslClientPolicy.setKeyPassword("defaultkeypass");
        sslClientPolicy.setKeystorePassword("defaultkeypass");

        sslClientPolicy.setKeystoreType("JKS");
        String trustStoreStr = getPath("resources/defaulttruststore");
        sslClientPolicy.setTrustStore(trustStoreStr);
        TestLogHandler handler = new TestLogHandler();
        HttpsURLConnectionFactory factory = createFactory(sslClientPolicy,
                                                          "https://dummyurl",
                                                          handler);
View Full Code Here

    @Test
    public void testAllValidDataPKCS12() throws Exception {

        String keyStoreStr = getPath("resources/celtix.p12");
        SSLClientPolicy sslClientPolicy = new SSLClientPolicy();
        sslClientPolicy.setKeystore(keyStoreStr);
        sslClientPolicy.setKeyPassword("celtixpass");
        sslClientPolicy.setKeystorePassword("celtixpass");

        sslClientPolicy.setKeystoreType("PKCS12");
        String trustStoreStr = getPath("resources/abigcompany_ca.pem");
        sslClientPolicy.setTrustStore(trustStoreStr);
        TestLogHandler handler = new TestLogHandler();
        HttpsURLConnectionFactory factory = createFactory(sslClientPolicy,
                                                          "https://dummyurl",
                                                          handler);
        factory.decorate(connection);
View Full Code Here

    @Test
    public void testNonExistentKeystoreJKS() throws Exception {

        String keyStoreStr = getPath("resources/defaultkeystoredontexist");
        SSLClientPolicy sslClientPolicy = new SSLClientPolicy();
        sslClientPolicy.setKeystore(keyStoreStr);
        sslClientPolicy.setKeyPassword("defaultkeypass");
        sslClientPolicy.setKeystorePassword("defaultkeypass");

        sslClientPolicy.setKeystoreType("JKS");
        String trustStoreStr = getPath("resources/defaulttruststore");
        sslClientPolicy.setTrustStore(trustStoreStr);
        TestLogHandler handler = new TestLogHandler();
        HttpsURLConnectionFactory factory = createFactory(sslClientPolicy,
                                                          "https://dummyurl",
                                                          handler);
        factory.decorate(connection);
View Full Code Here

    @Test
    public void testNonExistentKeystorePKCS12() throws Exception {

        String keyStoreStr = getPath("resources/defaultkeystoredontexist");
        SSLClientPolicy sslClientPolicy = new SSLClientPolicy();
        sslClientPolicy.setKeystore(keyStoreStr);
        sslClientPolicy.setKeyPassword("celtixpass");
        sslClientPolicy.setKeystorePassword("celtixpass");

        String trustStoreStr = getPath("resources/abigcompany_ca.pem");
        sslClientPolicy.setTrustStore(trustStoreStr);
        TestLogHandler handler = new TestLogHandler();
        HttpsURLConnectionFactory factory = createFactory(sslClientPolicy,
                                                          "https://dummyurl",
                                                          handler);
        factory.decorate(connection);
View Full Code Here

    @Test
    public void testWrongKeystorePasswordJKS() throws Exception {

        String keyStoreStr = getPath("resources/defaultkeystore");
        SSLClientPolicy sslClientPolicy = new SSLClientPolicy();
        sslClientPolicy.setKeystore(keyStoreStr);
        sslClientPolicy.setKeyPassword("defaultkeypass");
        sslClientPolicy.setKeystorePassword("defaultkeypasswrong");

        sslClientPolicy.setKeystoreType("JKS");
        String trustStoreStr = getPath("resources/defaulttruststore");
        sslClientPolicy.setTrustStore(trustStoreStr);
        TestLogHandler handler = new TestLogHandler();
        HttpsURLConnectionFactory factory = createFactory(sslClientPolicy,
                                                          "https://dummyurl",
                                                          handler);
        factory.decorate(connection);
View Full Code Here

TOP

Related Classes of org.apache.cxf.configuration.security.SSLClientPolicy

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.