protected SSLRecordProtocol recordProtocol;
/**
- * SSLParameters suplied by SSLSocket or SSLEngine
+ * SSLParametersImpl suplied by SSLSocket or SSLEngine
*/
- protected SSLParameters parameters;
+ protected SSLParametersImpl parameters;
/**
* Delegated tasks for this handshake implementation
public class OpenSSLServerSocketFactoryImpl extends javax.net.ssl.SSLServerSocketFactory {
- private SSLParameters sslParameters;
+ private SSLParametersImpl sslParameters;
private IOException instantiationException;
public OpenSSLServerSocketFactoryImpl() {
super();
try {
- this.sslParameters = SSLParameters.getDefault();
+ this.sslParameters = SSLParametersImpl.getDefault();
this.sslParameters.setUseClientMode(false);
} catch (KeyManagementException e) {
instantiationException =
}
}
- public OpenSSLServerSocketFactoryImpl(SSLParameters sslParameters) {
- this.sslParameters = (SSLParameters) sslParameters.clone();
+ public OpenSSLServerSocketFactoryImpl(SSLParametersImpl sslParameters) {
+ this.sslParameters = (SSLParametersImpl) sslParameters.clone();
this.sslParameters.setUseClientMode(false);
}
}
public ServerSocket createServerSocket() throws IOException {
- return new OpenSSLServerSocketImpl((SSLParameters) sslParameters.clone());
+ return new OpenSSLServerSocketImpl((SSLParametersImpl) sslParameters.clone());
}
public ServerSocket createServerSocket(int port) throws IOException {
- return new OpenSSLServerSocketImpl(port, (SSLParameters) sslParameters.clone());
+ return new OpenSSLServerSocketImpl(port, (SSLParametersImpl) sslParameters.clone());
}
public ServerSocket createServerSocket(int port, int backlog)
throws IOException {
return new OpenSSLServerSocketImpl(port,
backlog,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
public ServerSocket createServerSocket(int port,
return new OpenSSLServerSocketImpl(port,
backlog,
iAddress,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
}
* later, for example in the package.html or a separate reference document.
*/
public class OpenSSLServerSocketImpl extends javax.net.ssl.SSLServerSocket {
- private final SSLParameters sslParameters;
+ private final SSLParametersImpl sslParameters;
private String[] enabledProtocols = NativeCrypto.getSupportedProtocols();
private String[] enabledCipherSuites = NativeCrypto.getDefaultCipherSuites();
private String[] enabledCompressionMethods = NativeCrypto.getDefaultCompressionMethods();
- protected OpenSSLServerSocketImpl(SSLParameters sslParameters)
+ protected OpenSSLServerSocketImpl(SSLParametersImpl sslParameters)
throws IOException {
super();
this.sslParameters = sslParameters;
}
- protected OpenSSLServerSocketImpl(int port, SSLParameters sslParameters)
+ protected OpenSSLServerSocketImpl(int port, SSLParametersImpl sslParameters)
throws IOException {
super(port);
this.sslParameters = sslParameters;
}
- protected OpenSSLServerSocketImpl(int port, int backlog, SSLParameters sslParameters)
+ protected OpenSSLServerSocketImpl(int port, int backlog, SSLParametersImpl sslParameters)
throws IOException {
super(port, backlog);
this.sslParameters = sslParameters;
protected OpenSSLServerSocketImpl(int port,
int backlog,
InetAddress iAddress,
- SSLParameters sslParameters)
+ SSLParametersImpl sslParameters)
throws IOException {
super(port, backlog, iAddress);
this.sslParameters = sslParameters;
public class OpenSSLSocketFactoryImpl extends javax.net.ssl.SSLSocketFactory {
- private SSLParameters sslParameters;
+ private SSLParametersImpl sslParameters;
private IOException instantiationException;
public OpenSSLSocketFactoryImpl() {
super();
try {
- sslParameters = SSLParameters.getDefault();
+ sslParameters = SSLParametersImpl.getDefault();
} catch (KeyManagementException e) {
instantiationException =
new IOException("Delayed instantiation exception:");
}
}
- public OpenSSLSocketFactoryImpl(SSLParameters sslParameters) {
+ public OpenSSLSocketFactoryImpl(SSLParametersImpl sslParameters) {
super();
this.sslParameters = sslParameters;
}
if (instantiationException != null) {
throw instantiationException;
}
- return new OpenSSLSocketImpl((SSLParameters) sslParameters.clone());
+ return new OpenSSLSocketImpl((SSLParametersImpl) sslParameters.clone());
}
public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
- return new OpenSSLSocketImpl(host, port, (SSLParameters) sslParameters.clone());
+ return new OpenSSLSocketImpl(host, port, (SSLParametersImpl) sslParameters.clone());
}
public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
port,
localHost,
localPort,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
public Socket createSocket(InetAddress host, int port) throws IOException {
- return new OpenSSLSocketImpl(host, port, (SSLParameters) sslParameters.clone());
+ return new OpenSSLSocketImpl(host, port, (SSLParametersImpl) sslParameters.clone());
}
public Socket createSocket(InetAddress address,
port,
localAddress,
localPort,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
public Socket createSocket(Socket s, String host, int port, boolean autoClose)
host,
port,
autoClose,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
}
private final Object handshakeLock = new Object();
private final Object readLock = new Object();
private final Object writeLock = new Object();
- private SSLParameters sslParameters;
+ private SSLParametersImpl sslParameters;
private String[] enabledProtocols;
private String[] enabledCipherSuites;
private String[] enabledCompressionMethods;
* context
* @throws IOException if network fails
*/
- protected OpenSSLSocketImpl(SSLParameters sslParameters) throws IOException {
+ protected OpenSSLSocketImpl(SSLParametersImpl sslParameters) throws IOException {
super();
init(sslParameters);
}
* context
* @throws IOException if network fails
*/
- protected OpenSSLSocketImpl(SSLParameters sslParameters,
+ protected OpenSSLSocketImpl(SSLParametersImpl sslParameters,
String[] enabledProtocols,
String[] enabledCipherSuites,
String[] enabledCompressionMethods) throws IOException {
* @throws IOException if network fails
* @throws java.net.UnknownHostException host not defined
*/
- protected OpenSSLSocketImpl(String host, int port, SSLParameters sslParameters)
+ protected OpenSSLSocketImpl(String host, int port, SSLParametersImpl sslParameters)
throws IOException {
super(host, port);
init(sslParameters);
* @throws IOException if network fails
* @throws java.net.UnknownHostException host not defined
*/
- protected OpenSSLSocketImpl(InetAddress address, int port, SSLParameters sslParameters)
+ protected OpenSSLSocketImpl(InetAddress address, int port, SSLParametersImpl sslParameters)
throws IOException {
super(address, port);
init(sslParameters);
*/
protected OpenSSLSocketImpl(String host, int port,
InetAddress clientAddress, int clientPort,
- SSLParameters sslParameters)
+ SSLParametersImpl sslParameters)
throws IOException {
super(host, port, clientAddress, clientPort);
init(sslParameters);
*/
protected OpenSSLSocketImpl(InetAddress address, int port,
InetAddress clientAddress, int clientPort,
- SSLParameters sslParameters)
+ SSLParametersImpl sslParameters)
throws IOException {
super(address, port, clientAddress, clientPort);
init(sslParameters);
* @throws IOException if network fails
*/
protected OpenSSLSocketImpl(Socket socket, String host, int port,
- boolean autoClose, SSLParameters sslParameters) throws IOException {
+ boolean autoClose, SSLParametersImpl sslParameters) throws IOException {
super();
this.socket = socket;
this.timeout = socket.getSoTimeout();
* Initialize the SSL socket and set the certificates for the
* future handshaking.
*/
- private void init(SSLParameters sslParameters) throws IOException {
+ private void init(SSLParametersImpl sslParameters) throws IOException {
init(sslParameters,
NativeCrypto.getSupportedProtocols(),
NativeCrypto.getDefaultCipherSuites(),
* Initialize the SSL socket and set the certificates for the
* future handshaking.
*/
- private void init(SSLParameters sslParameters,
+ private void init(SSLParametersImpl sslParameters,
String[] enabledProtocols,
String[] enabledCipherSuites,
String[] enabledCompressionMethods) throws IOException {
private Socket socket;
protected OpenSSLSocketImplWrapper(Socket socket, String host, int port,
- boolean autoClose, SSLParameters sslParameters) throws IOException {
+ boolean autoClose, SSLParametersImpl sslParameters) throws IOException {
super(socket, host, port, autoClose, sslParameters);
if (!socket.isConnected()) {
throw new SocketException("Socket is not connected.");
/** Server session cache. */
private final ServerSessionContext serverSessionContext;
- protected SSLParameters sslParameters;
+ protected SSLParametersImpl sslParameters;
public SSLContextImpl() {
clientSessionContext = new ClientSessionContext();
clientSessionContext = DEFAULT_SSL_CONTEXT_IMPL.engineGetClientSessionContext();
serverSessionContext = DEFAULT_SSL_CONTEXT_IMPL.engineGetServerSessionContext();
}
- sslParameters = new SSLParameters(DEFAULT_SSL_CONTEXT_IMPL.getKeyManagers(),
- DEFAULT_SSL_CONTEXT_IMPL.getTrustManagers(),
- null,
- clientSessionContext,
- serverSessionContext);
+ sslParameters = new SSLParametersImpl(DEFAULT_SSL_CONTEXT_IMPL.getKeyManagers(),
+ DEFAULT_SSL_CONTEXT_IMPL.getTrustManagers(),
+ null,
+ clientSessionContext,
+ serverSessionContext);
}
}
@Override
public void engineInit(KeyManager[] kms, TrustManager[] tms,
SecureRandom sr) throws KeyManagementException {
- sslParameters = new SSLParameters(kms, tms, sr,
- clientSessionContext, serverSessionContext);
+ sslParameters = new SSLParametersImpl(kms, tms, sr,
+ clientSessionContext, serverSessionContext);
}
@Override
if (sslParameters == null) {
throw new IllegalStateException("SSLContext is not initialized.");
}
- SSLParameters p = (SSLParameters) sslParameters.clone();
+ SSLParametersImpl p = (SSLParametersImpl) sslParameters.clone();
p.setUseClientMode(false);
return new SSLEngineImpl(host, port, p);
}
if (sslParameters == null) {
throw new IllegalStateException("SSLContext is not initialized.");
}
- SSLParameters p = (SSLParameters) sslParameters.clone();
+ SSLParametersImpl p = (SSLParametersImpl) sslParameters.clone();
p.setUseClientMode(false);
return new SSLEngineImpl(p);
}
private SSLSessionImpl session;
// peer configuration parameters
- protected SSLParameters sslParameters;
+ protected SSLParametersImpl sslParameters;
// in case of emergency situations when data could not be
// placed in destination buffers it will be stored in this
// logger
private Logger.Stream logger = Logger.getStream("engine");
- protected SSLEngineImpl(SSLParameters sslParameters) {
+ protected SSLEngineImpl(SSLParametersImpl sslParameters) {
super();
this.sslParameters = sslParameters;
}
- protected SSLEngineImpl(String host, int port, SSLParameters sslParameters) {
+ protected SSLEngineImpl(String host, int port, SSLParametersImpl sslParameters) {
super(host, port);
this.sslParameters = sslParameters;
}
* and controls whether new SSL sessions may be established by this
* socket or not.
*/
-public class SSLParameters implements Cloneable {
+public class SSLParametersImpl implements Cloneable {
// default source of authentication keys
private static X509KeyManager defaultKeyManager;
// default source of random numbers
private static SecureRandom defaultSecureRandom;
// default SSL parameters
- private static SSLParameters defaultParameters;
+ private static SSLParametersImpl defaultParameters;
// client session context contains the set of reusable
// client-side SSL sessions
* See {@link javax.net.ssl.SSLContext#init(KeyManager[],TrustManager[],
* SecureRandom)} for more information
*/
- protected SSLParameters(KeyManager[] kms, TrustManager[] tms,
+ protected SSLParametersImpl(KeyManager[] kms, TrustManager[] tms,
// BEGIN android-changed
SecureRandom sr, ClientSessionContext clientSessionContext,
ServerSessionContext serverSessionContext)
// END android-added
}
- protected static SSLParameters getDefault() throws KeyManagementException {
+ protected static SSLParametersImpl getDefault() throws KeyManagementException {
if (defaultParameters == null) {
// BEGIN android-changed
- defaultParameters = new SSLParameters(null,
- null,
- null,
- new ClientSessionContext(),
- new ServerSessionContext());
+ defaultParameters = new SSLParametersImpl(null,
+ null,
+ null,
+ new ClientSessionContext(),
+ new ServerSessionContext());
// END android-changed
}
- return (SSLParameters) defaultParameters.clone();
+ return (SSLParametersImpl) defaultParameters.clone();
}
/**
*/
public class SSLServerSocketFactoryImpl extends SSLServerSocketFactory {
- private SSLParameters sslParameters;
+ private SSLParametersImpl sslParameters;
private IOException instantiationException;
/**
public SSLServerSocketFactoryImpl() {
super();
try {
- this.sslParameters = SSLParameters.getDefault();
+ this.sslParameters = SSLParametersImpl.getDefault();
this.sslParameters.setUseClientMode(false);
} catch (KeyManagementException e) {
instantiationException =
/**
* Constructor.
*/
- protected SSLServerSocketFactoryImpl(SSLParameters sslParameters) {
+ protected SSLServerSocketFactoryImpl(SSLParametersImpl sslParameters) {
super();
- this.sslParameters = (SSLParameters) sslParameters.clone();
+ this.sslParameters = (SSLParametersImpl) sslParameters.clone();
this.sslParameters.setUseClientMode(false);
}
if (instantiationException != null) {
throw instantiationException;
}
- return new SSLServerSocketImpl((SSLParameters) sslParameters.clone());
+ return new SSLServerSocketImpl((SSLParametersImpl) sslParameters.clone());
}
throw instantiationException;
}
return new SSLServerSocketImpl(port,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
/**
throw instantiationException;
}
return new SSLServerSocketImpl(port, backlog,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
/**
throw instantiationException;
}
return new SSLServerSocketImpl(port, backlog, iAddress,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
}
// ssl socket, whether it require/want client authentication or not,
// and controls whether new SSL sessions may be established by this
// socket or not.
- private final SSLParameters sslParameters;
+ private final SSLParametersImpl sslParameters;
// logger
private Logger.Stream logger = Logger.getStream("ssocket");
* @param sslParameters: SSLParameters
* @throws IOException
*/
- protected SSLServerSocketImpl(SSLParameters sslParameters)
+ protected SSLServerSocketImpl(SSLParametersImpl sslParameters)
throws IOException {
super();
this.sslParameters = sslParameters;
* @param sslParameters: SSLParameters
* @throws IOException
*/
- protected SSLServerSocketImpl(int port, SSLParameters sslParameters)
+ protected SSLServerSocketImpl(int port, SSLParametersImpl sslParameters)
throws IOException {
super(port);
this.sslParameters = sslParameters;
* @throws IOException
*/
protected SSLServerSocketImpl(int port, int backlog,
- SSLParameters sslParameters) throws IOException {
+ SSLParametersImpl sslParameters) throws IOException {
super(port, backlog);
this.sslParameters = sslParameters;
}
*/
protected SSLServerSocketImpl(int port, int backlog,
InetAddress iAddress,
- SSLParameters sslParameters)
+ SSLParametersImpl sslParameters)
throws IOException {
super(port, backlog, iAddress);
this.sslParameters = sslParameters;
logger.println("SSLServerSocketImpl.accept ..");
}
SSLSocketImpl s = new SSLSocketImpl(
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
implAccept(s);
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
*/
public class SSLSocketFactoryImpl extends SSLSocketFactory {
- private SSLParameters sslParameters;
+ private SSLParametersImpl sslParameters;
private IOException instantiationException;
/**
public SSLSocketFactoryImpl() {
super();
try {
- sslParameters = SSLParameters.getDefault();
+ sslParameters = SSLParametersImpl.getDefault();
} catch (KeyManagementException e) {
instantiationException =
new IOException("Delayed instantiation exception:");
/**
* Constructor.
*/
- protected SSLSocketFactoryImpl(SSLParameters sslParameters) {
+ protected SSLSocketFactoryImpl(SSLParametersImpl sslParameters) {
super();
this.sslParameters = sslParameters;
}
if (instantiationException != null) {
throw instantiationException;
}
- return new SSLSocketWrapper(s, autoClose, (SSLParameters) sslParameters
+ return new SSLSocketWrapper(s, autoClose, (SSLParametersImpl) sslParameters
.clone());
}
if (instantiationException != null) {
throw instantiationException;
}
- return new SSLSocketImpl((SSLParameters) sslParameters.clone());
+ return new SSLSocketImpl((SSLParametersImpl) sslParameters.clone());
}
/**
throw instantiationException;
}
return new SSLSocketImpl(host, port,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
/**
throw instantiationException;
}
return new SSLSocketImpl(host, port, localHost, localPort,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
/**
throw instantiationException;
}
return new SSLSocketImpl(host, port,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
/**
throw instantiationException;
}
return new SSLSocketImpl(address, port, localAddress, localPort,
- (SSLParameters) sslParameters.clone());
+ (SSLParametersImpl) sslParameters.clone());
}
// ------------------------------------------------------------------
// ssl socket, whether it require/want client authentication or not,
// and controls whether new SSL sessions may be established by this
// socket or not.
- protected SSLParameters sslParameters;
+ protected SSLParametersImpl sslParameters;
// super's streams to be wrapped:
protected InputStream input;
protected OutputStream output;
/**
* Constructor
- * @param sslParameters: SSLParameters
+ * @param sslParameters: SSLParametersImpl
* @see javax.net.ssl.SSLSocket#SSLSocket() method documentation
* for more information.
*/
- protected SSLSocketImpl(SSLParameters sslParameters) {
+ protected SSLSocketImpl(SSLParametersImpl sslParameters) {
super();
this.sslParameters = sslParameters;
// init should be called after creation!
* Constructor
* @param host: String
* @param port: int
- * @param sslParameters: SSLParameters
+ * @param sslParameters: SSLParametersImpl
* @throws IOException
* @throws UnknownHostException
* @see javax.net.ssl.SSLSocket#SSLSocket(String,int)
* method documentation for more information.
*/
- protected SSLSocketImpl(String host, int port, SSLParameters sslParameters)
+ protected SSLSocketImpl(String host, int port, SSLParametersImpl sslParameters)
throws IOException, UnknownHostException {
super(host, port);
this.sslParameters = sslParameters;
* @param port: int
* @param localHost: InetAddress
* @param localPort: int
- * @param sslParameters: SSLParameters
+ * @param sslParameters: SSLParametersImpl
* @throws IOException
* @throws UnknownHostException
* @see javax.net.ssl.SSLSocket#SSLSocket(String,int,InetAddress,int)
*/
protected SSLSocketImpl(String host, int port,
InetAddress localHost, int localPort,
- SSLParameters sslParameters) throws IOException,
+ SSLParametersImpl sslParameters) throws IOException,
UnknownHostException {
super(host, port, localHost, localPort);
this.sslParameters = sslParameters;
* Constructor
* @param host: InetAddress
* @param port: int
- * @param sslParameters: SSLParameters
+ * @param sslParameters: SSLParametersImpl
* @return
* @throws IOException
* @see javax.net.ssl.SSLSocket#SSLSocket(InetAddress,int)
* method documentation for more information.
*/
protected SSLSocketImpl(InetAddress host, int port,
- SSLParameters sslParameters) throws IOException {
+ SSLParametersImpl sslParameters) throws IOException {
super(host, port);
this.sslParameters = sslParameters;
init();
* @param port: int
* @param localAddress: InetAddress
* @param localPort: int
- * @param sslParameters: SSLParameters
+ * @param sslParameters: SSLParametersImpl
* @return
* @throws IOException
* @see javax.net.ssl.SSLSocket#SSLSocket(InetAddress,int,InetAddress,int)
*/
protected SSLSocketImpl(InetAddress address, int port,
InetAddress localAddress, int localPort,
- SSLParameters sslParameters) throws IOException {
+ SSLParametersImpl sslParameters) throws IOException {
super(address, port, localAddress, localPort);
this.sslParameters = sslParameters;
init();
private final Socket socket;
private final boolean autoClose;
- protected SSLSocketWrapper(Socket socket, boolean autoClose, SSLParameters sslParameters) throws IOException {
+ protected SSLSocketWrapper(Socket socket, boolean autoClose, SSLParametersImpl sslParameters) throws IOException {
super(sslParameters);
if (!socket.isConnected()) {
throw new SocketException("Socket is not connected.");