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
-
-
Constructor Summary
Constructors Constructor Description SSLConnection()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SSLConnectionforEngine(SSLEngine engine)Create aSSLConnectionfor the given SSL engine.static SSLConnectionforSession(SSLSession session, boolean clientMode)Create aSSLConnectionfor the given SSL socket.static SSLConnectionforSocket(SSLSocket socket)Create aSSLConnectionfor the given SSL socket.byte[]getChannelBinding(String bindingType)Get the channel binding of the given type from this connection.abstract SSLSessiongetSession()Get the SSL session associated with this connection.voidhandleChannelBindingCallback(ChannelBindingCallback callback)Populate the given channel binding callback with any channel binding data that might be present on this connection.abstract booleanisClientMode()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
nullif 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,nullis returned.- Returns:
- the channel binding of the given type from this connection, or
nullif 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 aSSLConnectionfor 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 aSSLConnectionfor 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 aSSLConnectionfor 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-trueif the session is client-side,falseif it is server-side- Returns:
- the SSL connection (not
null)
-
-