Fields Summary |
---|
static final int | READYIndicates that a is ready to be opened. |
static final int | OPENIndicates that a stream is opened. |
static final int | CLOSEDIndicates that a stream is closed. |
private Record | recCurrent record being processed. |
private In | uinInput stream for buffered records. |
private Out | uoutOutput stream for buffered records. |
private InputStream | sinRaw encrypted input stream. |
private OutputStream | soutRaw encrypted output stream. |
private String | hostCurrent host name. |
private int | portCurrent port number. |
private boolean | copenFlag indicating the underlying TCP connection is open. |
private X509Certificate | serverCertServer certificate from a successful handshake. |
private String | cipherSuiteCipher suite from a successful handshake. |
int | inputStreamStateState of the input stream given out by getInputStream. |
int | outputStreamStateState of the output stream given out by getOutputStream. |
Methods Summary |
---|
void | cleanupIfNeeded()Closes the SSL connection. The underlying TCP socket, over which
SSL is layered, is also closed unless the latter was opened by
an external application and its input/output streams were passed
as argument to the SSLStreamConnection constructor.
if (copen || inputStreamState == OPEN || outputStreamState == OPEN ||
rec == null) {
// we do not need to cleanup
return;
}
rec.shutdownConnection();
rec = null;
|
public synchronized void | close()Closes the SSL connection. The underlying TCP socket, over which
SSL is layered, is also closed unless the latter was opened by
an external application and its input/output streams were passed
as argument to the SSLStreamConnection constructor.
if (copen) {
copen = false;
cleanupIfNeeded();
}
|
java.lang.String | getCipherSuite()Returns the cipher suite in use for the connection.
The value returned is one of the CipherSuite definitions
in Appendix C of RFC 2246.
The cipher suite string should be used to represent the
actual parameters used to establish the connection regardless
of whether the secure connection uses SSL V3 or TLS 1.0 or WTLS.
return cipherSuite;
|
public javax.microedition.io.SecurityInfo | getSecurityInfo()Returns the security information associated with this connection.
if (!copen) {
throw new IOException("Connection closed");
}
return new SSLSecurityInfo(this);
|
public X509Certificate | getServerCertificate()Returns the server certificate associated with this connection.
return serverCert;
|
public java.io.DataInputStream | openDataInputStream()Returns the DataInputStream associated with this SSLStreamConnection.
return (new DataInputStream(openInputStream()));
|
public java.io.DataOutputStream | openDataOutputStream()Returns the DataOutputStream associated with this SSLStreamConnection.
return (new DataOutputStream(openOutputStream()));
|
public synchronized java.io.InputStream | openInputStream()Returns the InputStream associated with this SSLStreamConnection.
if (!copen) {
throw new IOException("Connection closed");
}
if (inputStreamState != READY) {
throw new IOException("Input stream already opened");
}
inputStreamState = OPEN;
return (uin);
|
public synchronized java.io.OutputStream | openOutputStream()Returns the OutputStream associated with this SSLStreamConnection.
if (!copen) {
throw new IOException("Connection closed");
}
if (outputStreamState != READY) {
throw new IOException("Output stream already opened");
}
outputStreamState = OPEN;
return (uout);
|