public class

SslRMIServerSocketFactory

extends Object
implements RMIServerSocketFactory
java.lang.Object
   ↳ javax.rmi.ssl.SslRMIServerSocketFactory
Known Direct Subclasses

Class Overview

An SslRMIServerSocketFactory instance is used by the RMI runtime in order to obtain server sockets for RMI calls via SSL.

This class implements RMIServerSocketFactory over the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocols.

This class creates SSL sockets using the default SSLSocketFactory (see getDefault()) or the default SSLServerSocketFactory (see getDefault()). Therefore, all instances of this class share the same keystore, and the same truststore, when client authentication is required by the server. This behavior can be modified in subclasses by overriding the createServerSocket(int) method; in that case, equals and hashCode may also need to be overridden.

Summary

Public Constructors
SslRMIServerSocketFactory()

Creates a new SslRMIServerSocketFactory with the default SSL socket configuration.

SslRMIServerSocketFactory(String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth)

Creates a new SslRMIServerSocketFactory with the specified SSL socket configuration.

Public Methods
ServerSocket createServerSocket(int port)

Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

final String[] getEnabledCipherSuites()

Returns the names of the cipher suites enabled on SSL connections accepted by server sockets created by this factory, or null if this factory uses the cipher suites that are enabled by default.

final String[] getEnabledProtocols()

Returns the names of the protocol versions enabled on SSL connections accepted by server sockets created by this factory, or null if this factory uses the protocol versions that are enabled by default.

final boolean getNeedClientAuth()

Returns true if client authentication is required on SSL connections accepted by server sockets created by this factory.

int hashCode()

Returns a hash code value for this SslRMIServerSocketFactory.

[Expand]
Inherited Methods
From class java.lang.Object
From interface java.rmi.server.RMIServerSocketFactory

Public Constructors

public SslRMIServerSocketFactory ()

Creates a new SslRMIServerSocketFactory with the default SSL socket configuration.

SSL connections accepted by server sockets created by this factory have the default cipher suites and protocol versions enabled and do not require client authentication.

public SslRMIServerSocketFactory (String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth)

Creates a new SslRMIServerSocketFactory with the specified SSL socket configuration.

Parameters
enabledCipherSuites names of all the cipher suites to enable on SSL connections accepted by server sockets created by this factory, or null to use the cipher suites that are enabled by default
enabledProtocols names of all the protocol versions to enable on SSL connections accepted by server sockets created by this factory, or null to use the protocol versions that are enabled by default
needClientAuth true to require client authentication on SSL connections accepted by server sockets created by this factory; false to not require client authentication
Throws
IllegalArgumentException when one or more of the cipher suites named by the enabledCipherSuites parameter is not supported, when one or more of the protocols named by the enabledProtocols parameter is not supported or when a problem is encountered while trying to check if the supplied cipher suites and protocols to be enabled are supported.

Public Methods

public ServerSocket createServerSocket (int port)

Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.

Parameters
port the port number
Returns
  • the server socket on the specified port
Throws
IOException

public boolean equals (Object obj)

Indicates whether some other object is "equal to" this one.

Two SslRMIServerSocketFactory objects are equal if they have been constructed with the same SSL socket configuration parameters.

A subclass should override this method (as well as hashCode()) if it adds instance state that affects equality.

Parameters
obj the reference object with which to compare.
Returns
  • true if this object is the same as the obj argument; false otherwise.

public final String[] getEnabledCipherSuites ()

Returns the names of the cipher suites enabled on SSL connections accepted by server sockets created by this factory, or null if this factory uses the cipher suites that are enabled by default.

Returns
  • an array of cipher suites enabled, or null

public final String[] getEnabledProtocols ()

Returns the names of the protocol versions enabled on SSL connections accepted by server sockets created by this factory, or null if this factory uses the protocol versions that are enabled by default.

Returns
  • an array of protocol versions enabled, or null

public final boolean getNeedClientAuth ()

Returns true if client authentication is required on SSL connections accepted by server sockets created by this factory.

Returns
  • true if client authentication is required

public int hashCode ()

Returns a hash code value for this SslRMIServerSocketFactory.

Returns
  • a hash code value for this SslRMIServerSocketFactory.