Java Reference
In-Depth Information
class. Secure socket factories encapsulate the details of creating and coniguring secure client sock-
ets at the time of their creation. his includes authentication keys, peer certiicate validation,
enabled cipher suites, and so on.
Likewise, the javax.net.ssl.SSLServerSocketFactory class is analogous to the
SSLSocketFactory class. his class extends the javax.net.SocketFactory class, and
as the name indicates, this class is used speciically for creating server sockets.
8.5.3.3 SSLSocket and SSLServerSocket Classes
he javax.net.ssl.SSLSocket class is a subclass of the standard Java java.net.Socket
class. he beauty of this class is that it supports all of the standard socket methods and provides
additional methods speciic to secure sockets. Instances of this class are the SSLSockets . hey
encapsulate the SSLContext under which they were created. Developers need to use appropriate
APIs to control the creation of secure socket sessions for a socket instance.
Similarly, the javax.net.ssl.SSLServerSocket class is analogous to the SSLSocket
class and used speciically for creating server SSLSockets . here are a number of methods
in both the classes that help in establishing SSL handshake and information transportation
between SSLSocket and SSLServerSocket . Some of the commonly used methods are the
following:
getEnabledProtocols()/setEnabledProtocols() —the getters and setters for
enabled protocols. While the getters return the names of the protocols that are currently
enabled for use by the newly accepted connections, the setters controls which particular
protocols are enabled for use by accepted connections.
getEnabledCipherSuites()/setEnabledCipherSuites(String[]
suites) —the getter and setters for EnabledCipherSuites . While the getters return
the list of cipher suites that are currently enabled for use by newly accepted connections, the
setters set the cipher suites enabled for use by accepted connections.
getEnableSessionCreation()/setEnableSessionCreation(Boolean
flag) —the getters and setters for EnabledSessionCreation . While the getters
return true if new SSL sessions may be established by the sockets that are created from
this server socket, the setters control whether new SSL sessions may be established by the
sockets that are created from this server socket.
getNeedClientAuth()/setNeedClientAuth(Boolean need) —the getters and
setters for managing the client authorization. While the getters return true if client authen-
tication will be required on newly accepted server-mode SSLSockets , the setters con-
trol whether accepted server-mode SSLSockets will be initially conigured to require client
authentication.
getUseClientMode()/setUseClientMode(Boolean model) —the getters and set-
ters for managing the client mode. While the getters return true if accepted connections will
be in SSL client mode, the setters control whether accepted connections are in the (default)
SSL server mode or the SSL client mode.
getWantClientAuth()/setWantClientAuth(Boolean want) —the getters and
setters for need for client authentication. While the getters return true if client authenti-
cation will be requested on newly accepted server-mode connections, the setters control
whether accepted server-mode SSLSockets will be initially conigured to request client
authentication.
Search WWH ::




Custom Search