Package org.wildfly.security.ssl
Class SSLConnection
- java.lang.Object
-
- org.wildfly.security.ssl.SSLConnection
-
public abstract class SSLConnection extends Object
An SSL connection of some sort.- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SSLConnection
forEngine(SSLEngine engine)
Create aSSLConnection
for the given SSL engine.static SSLConnection
forSession(SSLSession session, boolean clientMode)
Create aSSLConnection
for the given SSL socket.static SSLConnection
forSocket(SSLSocket socket)
Create aSSLConnection
for the given SSL socket.byte[]
getChannelBinding(String bindingType)
Get the channel binding of the given type from this connection.abstract SSLSession
getSession()
Get the SSL session associated with this connection.void
handleChannelBindingCallback(ChannelBindingCallback callback)
Populate the given channel binding callback with any channel binding data that might be present on this connection.abstract boolean
isClientMode()
Get the client-mode flag for this connection.
-
-
-
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 benull
)
-
forEngine
public static SSLConnection forEngine(SSLEngine engine)
Create aSSLConnection
for the given SSL engine.- Parameters:
engine
- the SSL engine (must not benull
)- Returns:
- the SSL connection (not
null
)
-
forSocket
public static SSLConnection forSocket(SSLSocket socket)
Create aSSLConnection
for the given SSL socket.- Parameters:
socket
- the SSL socket (must not benull
)- Returns:
- the SSL connection (not
null
)
-
forSession
public static SSLConnection forSession(SSLSession session, boolean clientMode)
Create aSSLConnection
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 benull
)clientMode
-true
if the session is client-side,false
if it is server-side- Returns:
- the SSL connection (not
null
)
-
-