This section describes the JSSE (Java Secure Socket Extension) package, which provides a Java implementation of the SSL and TLS protocols.
In JDK, the JSSE (Java Secure Socket Extension) package provides a Java implementation of
SSL and TLS protocols through the following major classes and interfaces:
javax.net.ssl.SSLServerSocket - Representing the server end of a secure
communication.
javax.net.ssl.SSLSocket - Representing the client end of a secure
communication.
javax.net.ssl.SSLServerSocketFactory - Used to create SSLServerSocket objects.
javax.net.ssl.SSLSocketFactory - Used to create SSLSocket objects.
javax.net.ssl.SSLContext - Representing a secure communication context.
Once initialized, it can be used as a factory to create SSLServerSocketFactory
objects and SSLSocketFactory objects.
javax.net.ssl.KeyManager - Responsible for managing the key material used
to authenticate the local SSLSocket.
javax.net.ssl.KeyManagerFactory - Used to create KeyManager objects based
on keys from a given KeyStore object.
You can create a default SSL client socket with 2 statements as shown below:
f = (SSLSocketFactory) SSLSocketFactory.getDefault();
s = (SSLSocket) f.createSocket();
You can create a default SSL server socket with 2 statements as shown below:
f = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
s = (SSLServerSocket) f.createServerSocket();