Package javax.net.ssl

Examples of javax.net.ssl.SSLSessionBindingEvent


    protected Object[] getData() {
        try {
            SSLContext cont = SSLContext.getInstance("TLS");
            cont.init(null, null, null);
            SSLSocket soc = (SSLSocket )cont.getSocketFactory().createSocket();
            return new Object[] { new SSLSessionBindingEvent(soc.getSession(), "someName")};
        } catch (Exception e) {
            fail("Can not create data: "+ e);
            return null;
        }
    }
View Full Code Here


            return null;
        }
    }

    public void assertDeserialized(Serializable oref, Serializable otest) {
        SSLSessionBindingEvent ref = (SSLSessionBindingEvent) oref;
        SSLSessionBindingEvent test = (SSLSessionBindingEvent) otest;
        assertEquals(ref.getName(), test.getName());
    }
View Full Code Here

*/
public class SSLSessionBindingEventTest extends TestCase {

    public final void testSSLSessionBindingEvent() {
        SSLSession ses = new MySSLSession();
        SSLSessionBindingEvent event = new SSLSessionBindingEvent(ses, "test");
        if (!"test".equals(event.getName())) {
            fail("incorrect name");
        }
        if (!event.getSession().equals(ses)) {
            fail("incorrect session");
        }
    }
View Full Code Here

            throw new IllegalArgumentException("Parameter is null");
        }
        Object old = values.put(name, AccessController.getContext(), value);
        if (value instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) value)
                    .valueBound(new SSLSessionBindingEvent(this, name));
        }
        if (old != null && old instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) old)
                    .valueUnbound(new SSLSessionBindingEvent(this, name));
        }

    }
View Full Code Here

        if (name == null || value == null) {
            throw new IllegalArgumentException("Parameter is null");
        }
        Object old = values.put(new ValueKey(name), value);
        if (value instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) value).valueBound(new SSLSessionBindingEvent(this, name));
        }
        if (old != null && old instanceof SSLSessionBindingListener) {
            ((SSLSessionBindingListener) old).valueUnbound(new SSLSessionBindingEvent(this, name));
        }

    }
View Full Code Here

    protected Object[] getData() {
        try {
            SSLContext cont = SSLContext.getInstance("TLS");
            cont.init(null, null, null);
            SSLSocket soc = (SSLSocket )cont.getSocketFactory().createSocket();
            return new Object[] { new SSLSessionBindingEvent(soc.getSession(), "someName")};
        } catch (Exception e) {
            fail("Can not create data: "+ e);
            return null;
        }
    }
View Full Code Here

            return null;
        }
    }

    public void assertDeserialized(Serializable oref, Serializable otest) {
        SSLSessionBindingEvent ref = (SSLSessionBindingEvent) oref;
        SSLSessionBindingEvent test = (SSLSessionBindingEvent) otest;
        assertEquals(ref.getName(), test.getName());
    }
View Full Code Here

        SecureKey secureKey = new SecureKey(key);
        Object oldValue = table.put(secureKey, value);

        if (oldValue instanceof SSLSessionBindingListener) {
            SSLSessionBindingEvent e;

            e = new SSLSessionBindingEvent(this, key);
            ((SSLSessionBindingListener)oldValue).valueUnbound(e);
        }
        if (value instanceof SSLSessionBindingListener) {
            SSLSessionBindingEvent e;

            e = new SSLSessionBindingEvent(this, key);
            ((SSLSessionBindingListener)value).valueBound(e);
        }
    }
View Full Code Here

        SecureKey secureKey = new SecureKey(key);
        Object value = table.remove(secureKey);

        if (value instanceof SSLSessionBindingListener) {
            SSLSessionBindingEvent e;

            e = new SSLSessionBindingEvent(this, key);
            ((SSLSessionBindingListener)value).valueUnbound(e);
        }
    }
View Full Code Here

        SecureKey secureKey = new SecureKey(key);
        Object oldValue = table.put(secureKey, value);

        if (oldValue instanceof SSLSessionBindingListener) {
            SSLSessionBindingEvent e;

            e = new SSLSessionBindingEvent(this, key);
            ((SSLSessionBindingListener)oldValue).valueUnbound(e);
        }
        if (value instanceof SSLSessionBindingListener) {
            SSLSessionBindingEvent e;

            e = new SSLSessionBindingEvent(this, key);
            ((SSLSessionBindingListener)value).valueBound(e);
        }
    }
View Full Code Here

TOP

Related Classes of javax.net.ssl.SSLSessionBindingEvent

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.