SSLParameters

public class SSLParameters extends Object

Encapsulates parameters for an SSL/TLS connection. The parameters are the list of ciphersuites to be accepted in an SSL/TLS handshake, the list of protocols to be allowed, the endpoint identification algorithm during SSL/TLS handshaking, the Server Name Indication (SNI), the algorithm constraints and whether SSL/TLS servers should request or require client authentication, etc.

SSLParameters can be created via the constructors in this class. Objects can also be obtained using the getSSLParameters() methods in SSLSocket and SSLServerSocket and SSLEngine or the getDefaultSSLParameters() and getSupportedSSLParameters() methods in SSLContext.

SSLParameters can be applied to a connection via the methods SSLSocket.setSSLParameters() and SSLServerSocket.setSSLParameters() and SSLEngine.setSSLParameters().

Public Constructor Summary

SSLParameters()
Constructs SSLParameters.
SSLParameters(String[] cipherSuites)
Constructs SSLParameters from the specified array of ciphersuites.
SSLParameters(String[] cipherSuites, String[] protocols)
Constructs SSLParameters from the specified array of ciphersuites and protocols.

Public Method Summary

AlgorithmConstraints
getAlgorithmConstraints()
Returns the cryptographic algorithm constraints.
String[]
getCipherSuites()
Returns a copy of the array of ciphersuites or null if none have been set.
String
getEndpointIdentificationAlgorithm()
Gets the endpoint identification algorithm.
boolean
getNeedClientAuth()
Returns whether client authentication should be required.
String[]
getProtocols()
Returns a copy of the array of protocols or null if none have been set.
final Collection<SNIMatcher>
getSNIMatchers()
Returns a Collection containing all SNIMatchers of the Server Name Indication (SNI) parameter, or null if none has been set.
final List<SNIServerName>
getServerNames()
Returns a List containing all SNIServerNames of the Server Name Indication (SNI) parameter, or null if none has been set.
final boolean
getUseCipherSuitesOrder()
Returns whether the local cipher suites preference should be honored.
boolean
getWantClientAuth()
Returns whether client authentication should be requested.
void
setAlgorithmConstraints(AlgorithmConstraints constraints)
Sets the cryptographic algorithm constraints, which will be used in addition to any configured by the runtime environment.
void
setCipherSuites(String[] cipherSuites)
Sets the array of ciphersuites.
void
setEndpointIdentificationAlgorithm(String algorithm)
Sets the endpoint identification algorithm.
void
setNeedClientAuth(boolean needClientAuth)
Sets whether client authentication should be required.
void
setProtocols(String[] protocols)
Sets the array of protocols.
final void
setSNIMatchers(Collection<SNIMatcher> matchers)
Sets the SNIMatchers of the Server Name Indication (SNI) parameter.
final void
setServerNames(List<SNIServerName> serverNames)
Sets the desired SNIServerNames of the Server Name Indication (SNI) parameter.
final void
setUseCipherSuitesOrder(boolean honorOrder)
Sets whether the local cipher suites preference should be honored.
void
setWantClientAuth(boolean wantClientAuth)
Sets whether client authentication should be requested.

Inherited Method Summary

Public Constructors

public SSLParameters ()

Constructs SSLParameters.

The values of cipherSuites, protocols, cryptographic algorithm constraints, endpoint identification algorithm, server names and server name matchers are set to null, useCipherSuitesOrder, wantClientAuth and needClientAuth are set to false.

public SSLParameters (String[] cipherSuites)

Constructs SSLParameters from the specified array of ciphersuites.

Calling this constructor is equivalent to calling the no-args constr