Package javax.net.ssl
Class SSLParameters
- java.lang.Object
-
- javax.net.ssl.SSLParameters
-
public class SSLParameters extends Object
SSL handshake parameters that include protocols, cipher suites, and client authentication requirements.- Since:
- 1.6
-
-
Constructor Summary
Constructors Constructor Description SSLParameters()The default SSLParameters constructor.SSLParameters(String[] cipherSuites)A SSLParameters constructor that allows the values for the initial cipher suites array to be provided.SSLParameters(String[] cipherSuites, String[] protocols)A SSLParameters constructor that allows the values for initial cipher suites and protocols arrays to be provided.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getCipherSuites()Returns a copy of the cipher suites, or null if none have been specified.booleangetNeedClientAuth()Returns true if a server requires authentication from a client during handshaking.String[]getProtocols()Returns a copy of the protocols, or null if none have been specified.booleangetWantClientAuth()Returns true if a server optionally wants to authenticate a client during handshaking.voidsetCipherSuites(String[] cipherSuites)Sets the cipher suites to a copy of the input, or nullvoidsetNeedClientAuth(boolean needClientAuth)Sets whether or not to a server needs client authentication.voidsetProtocols(String[] protocols)Sets the protocols to a copy of the input, or nullvoidsetWantClientAuth(boolean wantClientAuth)Sets whether or not to a server wants client authentication.
-
-
-
Constructor Detail
-
SSLParameters
public SSLParameters()
The default SSLParameters constructor. Cipher suites and protocols are initialized to null and client authentication options are initialized to false.
-
SSLParameters
public SSLParameters(String[] cipherSuites)
A SSLParameters constructor that allows the values for the initial cipher suites array to be provided. Other values default as specified inSSLParameters().- Parameters:
cipherSuites- An array of cipherSuites that is cloned for use within the SSLParameters, or null.
-
SSLParameters
public SSLParameters(String[] cipherSuites, String[] protocols)
A SSLParameters constructor that allows the values for initial cipher suites and protocols arrays to be provided. Other values default as specified inSSLParameters().- Parameters:
cipherSuites- An array of cipher names that is cloned for use within the SSLParameters, or null.protocols- An array of protocol names that is cloned for use within the SSLParameters, or null.
-
-
Method Detail
-
getCipherSuites
public String[] getCipherSuites()
Returns a copy of the cipher suites, or null if none have been specified.
-
setCipherSuites
public void setCipherSuites(String[] cipherSuites)
Sets the cipher suites to a copy of the input, or null
-
getProtocols
public String[] getProtocols()
Returns a copy of the protocols, or null if none have been specified.
-
setProtocols
public void setProtocols(String[] protocols)
Sets the protocols to a copy of the input, or null
-
getNeedClientAuth
public boolean getNeedClientAuth()
Returns true if a server requires authentication from a client during handshaking. If this returns true,getWantClientAuth()will return false.
-
setNeedClientAuth
public void setNeedClientAuth(boolean needClientAuth)
Sets whether or not to a server needs client authentication. After calling this, #getWantClientAuth() will return false.
-
getWantClientAuth
public boolean getWantClientAuth()
Returns true if a server optionally wants to authenticate a client during handshaking. If this returns true,getNeedClientAuth()will return false.
-
setWantClientAuth
public void setWantClientAuth(boolean wantClientAuth)
Sets whether or not to a server wants client authentication. After calling this, #getNeedClientAuth() will return false.
-
-