Class SSLConnection


  • public abstract class SSLConnection
    extends Object
    An SSL connection of some sort.
    Author:
    David M. Lloyd
    • Constructor Detail

      • SSLConnection

        SSLConnection()
    • Method Detail

      • getSession

        public abstract SSLSession getSession()
        Get the SSL session associated with this connection.
        Returns:
        the SSL session associated with this connection, or null if there is none
      • isClientMode

        public abstract boolean isClientMode()
        Get the client-mode flag for this connection.
        Returns:
        the client-mode flag for this connection
      • getChannelBinding

        public byte[] getChannelBinding​(String bindingType)
        Get the channel binding of the given type from this connection. If the data is not present or the type is not supported, null is returned.
        Returns:
        the channel binding of the given type from this connection, or null if it is not supported
      • handleChannelBindingCallback

        public void handleChannelBindingCallback​(ChannelBindingCallback callback)
        Populate the given channel binding callback with any channel binding data that might be present on this connection. If no channel binding seems to be supported, then the callback will be left unpopulated.
        Parameters:
        callback - the binding callback to populate (must not be null)
      • forEngine

        public static SSLConnection forEngine​(SSLEngine engine)
        Create a SSLConnection for the given SSL engine.
        Parameters:
        engine - the SSL engine (must not be null)
        Returns:
        the SSL connection (not null)
      • forSocket

        public static SSLConnection forSocket​(SSLSocket socket)
        Create a SSLConnection for the given SSL socket.
        Parameters:
        socket - the SSL socket (must not be null)
        Returns:
        the SSL connection (not null)
      • forSession

        public static SSLConnection forSession​(SSLSession session,
                                               boolean clientMode)
        Create a SSLConnection for the given SSL socket. Since no connection information will be available in this case, not all channel binding modes will be supported.
        Parameters:
        session - the SSL session (must not be null)
        clientMode - true if the session is client-side, false if it is server-side
        Returns:
        the SSL connection (not null)