public class SSL
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
SSL(java.lang.Object ssl,
Socket socket)
Store the reference to an SSL context.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Free any used resources on this connection.
|
java.lang.String |
getCertificateDN(int component)
Retrieve an X.509 distinguished name component.
|
byte |
getCipherId()
Return the SSL cipher id.
|
java.lang.Exception |
getLastException() |
byte[] |
getSessionId()
Get the session id for a handshake.
|
int |
handshakeStatus()
Return the result of a handshake.
|
int |
read(SSLReadHolder rh)
Read the SSL data stream.
|
int |
renegotiate()
Force the client to perform its handshake again.
|
int |
verifyCertificate()
Authenticate a received certificate.
|
int |
write(byte[] out_data)
Write to the SSL data stream.
|
int |
write(byte[] out_data,
int out_len)
Write to the SSL data stream.
|
protected SSL(java.lang.Object ssl, Socket socket)
ssl
- A reference to an SSL object.public final void dispose() throws IOException
IOException
public final int handshakeStatus()
public final byte getCipherId()
public final byte[] getSessionId()
public final java.lang.String getCertificateDN(int component) throws CryptoException
component
- [in] one of:
- SSL_X509_CERT_COMMON_NAME
- SSL_X509_CERT_ORGANIZATION
- SSL_X509_CERT_ORGANIZATIONAL_NAME
- SSL_X509_CA_CERT_COMMON_NAME
- SSL_X509_CA_CERT_ORGANIZATION
- SSL_X509_CA_CERT_ORGANIZATIONAL_NAMECryptoException
public final int read(SSLReadHolder rh) throws SocketTimeoutException, IOException
rh
- [out] After a successful read, the decrypted data can be
retrieved with rh.getData(). It will be null otherwise.SocketTimeoutException
IOException
public final int write(byte[] out_data) throws IOException
out_data
- [in] The data to be writtenIOException
public final int write(byte[] out_data, int out_len) throws IOException
out_data
- [in] The data to be writtenout_len
- [in] The number of bytes to be writtenIOException
public final int verifyCertificate() throws CryptoException
CryptoException
public final int renegotiate() throws IOException
IOException
public final java.lang.Exception getLastException()