FileDocCategorySizeDatePackage
SSLContextImpl.javaAPI DocAndroid 1.5 API4643Wed May 06 22:41:06 BST 2009org.apache.harmony.xnet.provider.jsse

SSLContextImpl

public class SSLContextImpl extends SSLContextSpi
Implementation of SSLContext service provider interface.

Fields Summary
private ClientSessionContext
clientSessionContext
Client session cache.
private ServerSessionContext
serverSessionContext
Server session cache.
protected org.apache.harmony.xnet.provider.jsse.SSLParameters
sslParameters
Constructors Summary
public SSLContextImpl()

        super();
    
Methods Summary
public javax.net.ssl.SSLEngineengineCreateSSLEngine(java.lang.String host, int port)

        if (sslParameters == null) {
            throw new IllegalStateException("SSLContext is not initiallized.");
        }
        return new SSLEngineImpl(host, port,
                (SSLParameters) sslParameters.clone());
    
public javax.net.ssl.SSLEngineengineCreateSSLEngine()

        if (sslParameters == null) {
            throw new IllegalStateException("SSLContext is not initiallized.");
        }
        return new SSLEngineImpl((SSLParameters) sslParameters.clone());
    
public ClientSessionContextengineGetClientSessionContext()

        return clientSessionContext;
    
public ServerSessionContextengineGetServerSessionContext()

        return serverSessionContext;
    
public javax.net.ssl.SSLServerSocketFactoryengineGetServerSocketFactory()

        if (sslParameters == null) {
            throw new IllegalStateException("SSLContext is not initiallized.");
        }
        return new OpenSSLServerSocketFactoryImpl(sslParameters);
    
public javax.net.ssl.SSLSocketFactoryengineGetSocketFactory()

        if (sslParameters == null) {
            throw new IllegalStateException("SSLContext is not initiallized.");
        }
        return new OpenSSLSocketFactoryImpl(sslParameters);
    
public voidengineInit(javax.net.ssl.KeyManager[] kms, javax.net.ssl.TrustManager[] tms, java.security.SecureRandom sr)

        engineInit(kms, tms, sr, null, null);
    
public voidengineInit(javax.net.ssl.KeyManager[] kms, javax.net.ssl.TrustManager[] tms, java.security.SecureRandom sr, SSLClientSessionCache clientCache, SSLServerSessionCache serverCache)
Initializes this {@code SSLContext} instance. All of the arguments are optional, and the security providers will be searched for the required implementations of the needed algorithms.

param
kms the key sources or {@code null}
param
tms the trust decision sources or {@code null}
param
sr the randomness source or {@code null}
param
clientCache persistent client session cache or {@code null}
param
serverCache persistent server session cache or {@code null}
throws
KeyManagementException if initializing this instance fails
since
Android 1.1

        sslParameters = new SSLParameters(kms, tms, sr,
                clientCache, serverCache);
        clientSessionContext = sslParameters.getClientSessionContext();
        serverSessionContext = sslParameters.getServerSessionContext();