Search in sources :

Example 1 with SSLSessionBindingEvent

use of javax.net.ssl.SSLSessionBindingEvent in project robovm by robovm.

the class MySSLSession method test_getSession.

/**
     * javax.net.ssl.SSLSessionBindingEvent#getSession()
     */
public void test_getSession() {
    SSLSession ses = new MySSLSession();
    SSLSessionBindingEvent event = new SSLSessionBindingEvent(ses, "test");
    assertEquals("Incorrect session", ses, event.getSession());
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSession(javax.net.ssl.SSLSession)

Example 2 with SSLSessionBindingEvent

use of javax.net.ssl.SSLSessionBindingEvent in project robovm by robovm.

the class MySSLSession method test_getName.

/**
     * javax.net.ssl.SSLSessionBindingEvent#getName()
     */
public void test_getName() {
    SSLSession ses = new MySSLSession();
    SSLSessionBindingEvent event = new SSLSessionBindingEvent(ses, "test");
    assertEquals("Incorrect session name", "test", event.getName());
    event = new SSLSessionBindingEvent(ses, null);
    assertEquals("Incorrect session name", null, event.getName());
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSession(javax.net.ssl.SSLSession)

Example 3 with SSLSessionBindingEvent

use of javax.net.ssl.SSLSessionBindingEvent in project robovm by robovm.

the class mySSLSession method putValue.

public void putValue(String s, Object obj) {
    if (s == null || obj == null)
        throw new IllegalArgumentException("arguments can not be null");
    Object obj1 = table.put(s, obj);
    if (obj1 instanceof SSLSessionBindingListener) {
        SSLSessionBindingEvent sslsessionbindingevent = new SSLSessionBindingEvent(this, s);
        ((SSLSessionBindingListener) obj1).valueUnbound(sslsessionbindingevent);
    }
    if (obj instanceof SSLSessionBindingListener) {
        SSLSessionBindingEvent sslsessionbindingevent1 = new SSLSessionBindingEvent(this, s);
        ((SSLSessionBindingListener) obj).valueBound(sslsessionbindingevent1);
    }
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSessionBindingListener(javax.net.ssl.SSLSessionBindingListener)

Example 4 with SSLSessionBindingEvent

use of javax.net.ssl.SSLSessionBindingEvent in project XobotOS by xamarin.

the class SSLSessionImpl method removeValue.

public void removeValue(String name) {
    if (name == null) {
        throw new IllegalArgumentException("name == null");
    }
    Object old = values.remove(name);
    if (old instanceof SSLSessionBindingListener) {
        SSLSessionBindingListener listener = (SSLSessionBindingListener) old;
        listener.valueUnbound(new SSLSessionBindingEvent(this, name));
    }
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSessionBindingListener(javax.net.ssl.SSLSessionBindingListener)

Example 5 with SSLSessionBindingEvent

use of javax.net.ssl.SSLSessionBindingEvent in project XobotOS by xamarin.

the class OpenSSLSessionImpl method removeValue.

/**
     * Removes a link (name) with the specified value object of the SSL
     * session's application layer data.
     *
     * <p>If the value object implements the <code>SSLSessionBindingListener</code>
     * interface, the object will receive a <code>valueUnbound</code> notification.
     *
     * <p>These links-to -data bounds are
     * monitored, as a matter of security, by the full machinery of the
     * <code>AccessController</code> class.
     *
     * @param name the name of the link (no null are
     *            accepted!)
     * @throws <code>IllegalArgumentException</code> if the argument is null.
     */
public void removeValue(String name) {
    if (name == null) {
        throw new IllegalArgumentException("name == null");
    }
    Object old = values.remove(name);
    if (old instanceof SSLSessionBindingListener) {
        SSLSessionBindingListener listener = (SSLSessionBindingListener) old;
        listener.valueUnbound(new SSLSessionBindingEvent(this, name));
    }
}
Also used : SSLSessionBindingEvent(javax.net.ssl.SSLSessionBindingEvent) SSLSessionBindingListener(javax.net.ssl.SSLSessionBindingListener)

Aggregations

SSLSessionBindingEvent (javax.net.ssl.SSLSessionBindingEvent)14 SSLSessionBindingListener (javax.net.ssl.SSLSessionBindingListener)11 SSLSession (javax.net.ssl.SSLSession)4 SelfSignedCertificate (io.netty.handler.ssl.util.SelfSignedCertificate)1 ExtendedSSLSession (javax.net.ssl.ExtendedSSLSession)1 SSLEngine (javax.net.ssl.SSLEngine)1 SSLPeerUnverifiedException (javax.net.ssl.SSLPeerUnverifiedException)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1