|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.filter.SSLReadFilter
public class SSLReadFilter
Simple ProtocolFilter implementation which execute an SSL handshake and decrypt the bytes, the pass the control to the next filter.
Field Summary | |
---|---|
protected int |
inputBBSize
Encrypted ByteBuffer default size. |
protected SSLContext |
sslContext
The SSLContext associated with the SSL implementation
we are running on. |
Fields inherited from interface com.sun.grizzly.ProtocolFilter |
---|
SUCCESSFUL_READ |
Constructor Summary | |
---|---|
SSLReadFilter()
|
Method Summary | |
---|---|
protected void |
allocateBuffers()
Allocate themandatory ByteBuffer s. |
void |
configure(SSLConfig sslConfig)
Configures SSL settings. |
static Object[] |
doPeerCertificateChain(SelectionKey key,
boolean needClientAuth)
Get the peer certificate list by initiating a new handshake. |
boolean |
execute(Context ctx)
Execute a unit of processing work to be performed. |
String[] |
getEnabledCipherSuites()
Returns the list of cipher suites to be enabled when SSLEngine
is initialized. |
String[] |
getEnabledProtocols()
Returns the list of protocols to be enabled when SSLEngine
is initialized. |
SSLContext |
getSSLContext()
Return the SSLContext required to support SSL over NIO. |
boolean |
isClientMode()
Returns true if the SSlEngine is set to use client mode when handshaking. |
boolean |
isNeedClientAuth()
Returns true if the SSLEngine will require client authentication. |
boolean |
isWantClientAuth()
Returns true if the engine will request client authentication. |
protected static void |
log(String msg,
Throwable t)
Log a message/exception. |
protected SSLEngine |
newSSLEngine()
Return a new configured SSLEngine |
protected SSLEngine |
newSSLEngine(SelectionKey key)
Configure and return an instance of SSLEngine |
boolean |
postExecute(Context ctx)
If no bytes were available, close the connection by cancelling the SelectionKey. |
void |
setClientMode(boolean clientMode)
Configures the engine to use client (or server) mode when handshaking. |
void |
setEnabledCipherSuites(String[] enabledCipherSuites)
Sets the list of cipher suites to be enabled when SSLEngine
is initialized. |
void |
setEnabledProtocols(String[] enabledProtocols)
Sets the list of protocols to be enabled when SSLEngine
is initialized. |
void |
setNeedClientAuth(boolean needClientAuth)
Configures the engine to require client authentication. |
void |
setSSLContext(SSLContext sslContext)
Set the SSLContext required to support SSL over NIO. |
void |
setWantClientAuth(boolean wantClientAuth)
Configures the engine to request client authentication. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SSLContext sslContext
SSLContext
associated with the SSL implementation
we are running on.
protected int inputBBSize
Constructor Detail |
---|
public SSLReadFilter()
Method Detail |
---|
public boolean execute(Context ctx) throws IOException
ProtocolFilter
execute
in interface ProtocolFilter
ctx
- Context
IOException
public boolean postExecute(Context ctx) throws IOException
postExecute
in interface ProtocolFilter
ctx
- Context
IOException
protected void allocateBuffers()
ByteBuffer
s. Since the ByteBuffer
are maintaned on the WorkerThread
lazily, this method
makes sure the ByteBuffers are properly allocated and configured.
public static Object[] doPeerCertificateChain(SelectionKey key, boolean needClientAuth) throws IOException
key
- SelectionKey
needClientAuth
-
IOException
protected SSLEngine newSSLEngine()
SSLEngine
SSLEngine
protected SSLEngine newSSLEngine(SelectionKey key)
key
- a SelectionKey
SSLEngine
public void configure(SSLConfig sslConfig)
SSLConfig
contains all the parameters
required to build SSLEngine
. There will be no need to call
four methods: setSSLContext, setClientMode, setWantClientAuth,
setNeedClientAuth.
sslConfig
- SSLConfig
configurationpublic void setSSLContext(SSLContext sslContext)
sslContext
- SSLContext
public SSLContext getSSLContext()
SSLContext
public String[] getEnabledCipherSuites()
SSLEngine
is initialized.
SSLEngine
's default.'public void setEnabledCipherSuites(String[] enabledCipherSuites)
SSLEngine
is initialized.
enabledCipherSuites
- public String[] getEnabledProtocols()
SSLEngine
is initialized.
SSLEngine
's default.'public void setEnabledProtocols(String[] enabledProtocols)
SSLEngine
is initialized.
enabledProtocols
- null means 'use SSLEngine
's default.'public boolean isClientMode()
public void setClientMode(boolean clientMode)
clientMode
- public boolean isNeedClientAuth()
public void setNeedClientAuth(boolean needClientAuth)
needClientAuth
- public boolean isWantClientAuth()
public void setWantClientAuth(boolean wantClientAuth)
wantClientAuth
- protected static void log(String msg, Throwable t)
msg
- String
t
- Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |