Package org.conscrypt
Class SSLParametersImpl
java.lang.Object
org.conscrypt.SSLParametersImpl
- All Implemented Interfaces:
Cloneable
public class SSLParametersImpl extends Object implements Cloneable
The instances of this class encapsulate all the info
about enabled cipher suites and protocols,
as well as the information about client/server mode of
ssl socket, whether it require/want client authentication or not,
and controls whether new SSL sessions may be established by this
socket or not.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSSLParametersImpl(KeyManager[] kms, TrustManager[] tms, SecureRandom sr, ClientSessionContext clientSessionContext, ServerSessionContext serverSessionContext)Initializes the parameters. -
Method Summary
Modifier and Type Method Description protected Objectclone()Returns the clone of this object.protected ClientSessionContextgetClientSessionContext()protected static SSLParametersImplgetDefault()static X509TrustManagergetDefaultTrustManager()Gets the default trust manager.protected String[]getEnabledCipherSuites()protected CipherSuite[]getEnabledCipherSuitesMember()protected String[]getEnabledProtocols()protected booleangetEnableSessionCreation()Returns the value indicating if the peer with this parameters allowed to cteate new SSL sessionprotected X509KeyManagergetKeyManager()protected booleangetNeedClientAuth()Returns the value indicating if the peer with this parameters tuned to require client authenticationprotected SecureRandomgetSecureRandom()protected SecureRandomgetSecureRandomMember()protected ServerSessionContextgetServerSessionContext()protected X509TrustManagergetTrustManager()protected booleangetUseClientMode()Returns the value indicating if the parameters configured to work in client mode.protected booleangetWantClientAuth()Returns the value indicating if the peer with this parameters tuned to request client authenticationprotected voidsetEnabledCipherSuites(String[] suites)Sets the set of available cipher suites for use in SSL connection.protected voidsetEnabledProtocols(String[] protocols)Sets the set of available protocols for use in SSL connection.protected voidsetEnableSessionCreation(boolean flag)Allows/disallows the peer holding this parameters to create new SSL sessionprotected voidsetNeedClientAuth(boolean need)Tunes the peer holding this parameters to require client authenticationprotected voidsetUseClientMode(boolean mode)Tunes the peer holding this parameters to work in client mode.protected voidsetWantClientAuth(boolean want)Tunes the peer holding this parameters to request client authentication
-
Constructor Details
-
SSLParametersImpl
protected SSLParametersImpl(KeyManager[] kms, TrustManager[] tms, SecureRandom sr, ClientSessionContext clientSessionContext, ServerSessionContext serverSessionContext) throws KeyManagementExceptionInitializes the parameters. Naturally this constructor is used in SSLContextImpl.engineInit method which directly passes its parameters. In other words this constructor holds all the functionality provided by SSLContext.init method. SeeSSLContext.init(KeyManager[],TrustManager[], SecureRandom)for more information- Throws:
KeyManagementException
-
-
Method Details
-
getEnabledCipherSuitesMember
-
getDefault
- Throws:
KeyManagementException
-
getServerSessionContext
- Returns:
- server session context
-
getClientSessionContext
- Returns:
- client session context
-
getKeyManager
- Returns:
- key manager
-
getTrustManager
- Returns:
- trust manager
-
getSecureRandom
- Returns:
- secure random
-
getSecureRandomMember
- Returns:
- the secure random member reference, even it is null
-
getEnabledCipherSuites
- Returns:
- the names of enabled cipher suites
-
setEnabledCipherSuites
Sets the set of available cipher suites for use in SSL connection.- Parameters:
suites- : String[]
-
getEnabledProtocols
- Returns:
- the set of enabled protocols
-
setEnabledProtocols
Sets the set of available protocols for use in SSL connection.- Parameters:
protocols- String[]
-
setUseClientMode
protected void setUseClientMode(boolean mode)Tunes the peer holding this parameters to work in client mode.- Parameters:
mode- if the peer is configured to work in client mode
-
getUseClientMode
protected boolean getUseClientMode()Returns the value indicating if the parameters configured to work in client mode. -
setNeedClientAuth
protected void setNeedClientAuth(boolean need)Tunes the peer holding this parameters to require client authentication -
getNeedClientAuth
protected boolean getNeedClientAuth()Returns the value indicating if the peer with this parameters tuned to require client authentication -
setWantClientAuth
protected void setWantClientAuth(boolean want)Tunes the peer holding this parameters to request client authentication -
getWantClientAuth
protected boolean getWantClientAuth()Returns the value indicating if the peer with this parameters tuned to request client authentication- Returns:
-
setEnableSessionCreation
protected void setEnableSessionCreation(boolean flag)Allows/disallows the peer holding this parameters to create new SSL session -
getEnableSessionCreation
protected boolean getEnableSessionCreation()Returns the value indicating if the peer with this parameters allowed to cteate new SSL session -
clone
Returns the clone of this object. -
getDefaultTrustManager
Gets the default trust manager. TODO: Move this to a published API under dalvik.system.- Throws:
KeyManagementException
-