Package javax.net.ssl

Examples of javax.net.ssl.SSLContextSpi


            KeyManagementException {
        if (!DEFSupported) {
            fail(NotSupportMsg);
            return;
        }
        SSLContextSpi spi = new MySSLContextSpi();
        SSLContext sslContext = new mySSLContext(spi, defaultProvider,
                defaultProtocol);
        assertTrue("Not CertStore object", sslContext instanceof SSLContext);
        assertEquals("Incorrect protocol", sslContext.getProtocol(),
                defaultProtocol);
View Full Code Here


            KeyManagementException {
        if (!DEFSupported) {
            fail(NotSupportMsg);
            return;
        }
        SSLContextSpi spi = new MySSLContextSpi();
        SSLContext sslContext = new mySSLContext(spi, defaultProvider,
                defaultProtocol);
        assertTrue("Not CertStore object", sslContext instanceof SSLContext);
        assertEquals("Incorrect protocol", sslContext.getProtocol(),
                defaultProtocol);
View Full Code Here

            KeyManagementException {
        if (!DEFSupported) {
            fail(NotSupportMsg);
            return;
        }
        SSLContextSpi spi = new MySSLContextSpi();
        SSLContext sslContext = new MySSLContext(spi, defaultProvider,
                defaultProtocol);
        assertTrue("Not CertStore object", sslContext instanceof SSLContext);
        assertEquals("Incorrect protocol", sslContext.getProtocol(),
                defaultProtocol);
View Full Code Here

    /**
     * Test for <code>SSLContextSpi</code> constructor
     * Assertion: constructs SSLContextSpi
     */
    public void testSSLContextSpi01() throws KeyManagementException {
        SSLContextSpi sslConSpi = new MySSLContextSpi();
        try {
            sslConSpi.engineGetSocketFactory();
            fail("RuntimeException must be thrown");
        } catch (RuntimeException e) {
            assertEquals("Incorrect message", "Not initialiazed", e.getMessage());
        }
        try {
            sslConSpi.engineGetServerSocketFactory();
            fail("RuntimeException must be thrown");
        } catch (RuntimeException e) {
            assertEquals("Incorrect message", "Not initialiazed", e.getMessage());
        }
        try {
            sslConSpi.engineGetServerSessionContext();
            fail("RuntimeException must be thrown");
        } catch (RuntimeException e) {
            assertEquals("Incorrect message", "Not initialiazed", e.getMessage());
        }
        try {
            sslConSpi.engineGetClientSessionContext();
            fail("RuntimeException must be thrown");
        } catch (RuntimeException e) {
            assertEquals("Incorrect message", "Not initialiazed", e.getMessage());
        }      
        try {
            sslConSpi.engineCreateSSLEngine();
            fail("RuntimeException must be thrown");
        } catch (RuntimeException e) {
            assertEquals("Incorrect message", "Not initialiazed", e.getMessage());
        }
        try {
            sslConSpi.engineCreateSSLEngine("host",1);
            fail("RuntimeException must be thrown");
        } catch (RuntimeException e) {
            assertEquals("Incorrect message", "Not initialiazed", e.getMessage());
        }
        sslConSpi.engineInit(null, null, new SecureRandom());
        assertNull("Not null result", sslConSpi.engineGetSocketFactory());
        assertNull("Not null result", sslConSpi.engineGetServerSocketFactory());
        assertNotNull("Null result", sslConSpi.engineCreateSSLEngine());
        assertNotNull("Null result", sslConSpi.engineCreateSSLEngine("host",1));
        assertNull("Not null result", sslConSpi.engineGetServerSessionContext());
        assertNull("Not null result", sslConSpi.engineGetClientSessionContext());
    }
View Full Code Here

TOP

Related Classes of javax.net.ssl.SSLContextSpi

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.