public class OpenSSLSessionImpl extends Object implements SSLSession
| Modifier and Type | Field and Description |
|---|---|
protected long |
sslSessionNativePointer |
| Modifier | Constructor and Description |
|---|---|
protected |
OpenSSLSessionImpl(long sslSessionNativePointer,
X509Certificate[] localCertificates,
X509Certificate[] peerCertificates,
String peerHost,
int peerPort,
org.conscrypt.AbstractSessionContext sessionContext)
Class constructor creates an SSL session context given the appropriate
SSL parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
int |
getApplicationBufferSize()
Returns the largest buffer size for the application's data bound to this
concrete SSL session.
|
String |
getCipherSuite()
Returns a string identifier of the crypto tools used in the actual SSL
session.
|
long |
getCreationTime()
Gets the creation time of the SSL session.
|
byte[] |
getId()
Gets the identifier of the actual SSL session
|
long |
getLastAccessedTime()
Returns the last time this concrete SSL session was accessed.
|
Certificate[] |
getLocalCertificates()
Returns the certificate(s) of the principal (subject) of this concrete SSL
session used in the handshaking phase of the connection.
|
Principal |
getLocalPrincipal()
Returns the principal (subject) of this concrete SSL session used in the
handshaking phase of the connection.
|
int |
getPacketBufferSize()
Returns the largest SSL/TLS packet size one can expect for this concrete
SSL session.
|
X509Certificate[] |
getPeerCertificateChain()
Returns the certificate(s) of the peer in this SSL session
used in the handshaking phase of the connection.
|
Certificate[] |
getPeerCertificates()
Return the identity of the peer in this SSL session
determined via certificate(s).
|
String |
getPeerHost()
The peer's host name used in this SSL session is returned.
|
int |
getPeerPort()
Returns the peer's port number for the actual SSL session.
|
Principal |
getPeerPrincipal()
The identity of the principal that was used by the peer during the SSL
handshake phase is returned by this method.
|
String |
getProtocol()
Returns the standard version name of the SSL protocol used in all
connections pertaining to this SSL session.
|
SSLSessionContext |
getSessionContext()
Returns the context to which the actual SSL session is bound.
|
Object |
getValue(String name)
Returns the object which is bound to the the input parameter name.
|
String[] |
getValueNames()
Returns an array with the names (sort of links) of all the data
objects of the application layer bound into the SSL session.
|
void |
invalidate()
It invalidates a SSL session forbidding any resumption.
|
boolean |
isValid()
Returns a boolean flag signaling whether a SSL session is valid
and available for resuming or joining or not.
|
void |
putValue(String name,
Object value)
A link (name) with the specified value object of the SSL session's
application layer data is created or replaced.
|
void |
removeValue(String name)
Removes a link (name) with the specified value object of the SSL
session's application layer data.
|
protected OpenSSLSessionImpl(long sslSessionNativePointer,
X509Certificate[] localCertificates,
X509Certificate[] peerCertificates,
String peerHost,
int peerPort,
org.conscrypt.AbstractSessionContext sessionContext)
public byte[] getId()
getId in interface SSLSessionpublic long getCreationTime()
getCreationTime in interface SSLSessionpublic long getLastAccessedTime()
getLastAccessedTime in interface SSLSessionpublic int getApplicationBufferSize()
getApplicationBufferSize in interface SSLSessionpublic int getPacketBufferSize()
getPacketBufferSize in interface SSLSessionpublic Principal getLocalPrincipal()
getLocalPrincipal in interface SSLSessionpublic Certificate[] getLocalCertificates()
getLocalCertificates in interface SSLSessionpublic X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException
getPeerCertificates().getPeerCertificateChain in interface SSLSessionSSLPeerUnverifiedException - if either a non-X.509 certificate
was used (i.e. Kerberos certificates) or the peer could not
be verified.public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException
getPeerCertificates in interface SSLSessionSSLPeerUnverifiedException - if either a non-X.509 certificate
was used (i.e. Kerberos certificates) or the peer could not
be verified.public Principal getPeerPrincipal() throws SSLPeerUnverifiedException
getPeerPrincipal in interface SSLSessionSSLPeerUnverifiedException - if either a non-X.509 certificate
was used (i.e. Kerberos certificates) or the peer does not exist.public String getPeerHost()
getPeerHost in interface SSLSessionnull if no information is
available.public int getPeerPort()
getPeerPort in interface SSLSession-1 if no one is available.public String getCipherSuite()
getCipherSuite in interface SSLSessionpublic String getProtocol()
getProtocol in interface SSLSessionpublic SSLSessionContext getSessionContext()
getSessionContext in interface SSLSessionpublic boolean isValid()
isValid in interface SSLSessionpublic void invalidate()
invalidate in interface SSLSessionpublic Object getValue(String name)
getValue in interface SSLSessionname - the name of the binding to find.IllegalArgumentException - if the argument is null.public String[] getValueNames()
getValueNames in interface SSLSessionpublic void putValue(String name, Object value)
SSLSessionBindingListener
interface, that object will be notified in due course.putValue in interface SSLSessionname - the name of the link (no null are
accepted!)value - data object that shall be bound to
name.IllegalArgumentException - if one or both argument(s) is null.public void removeValue(String name)
If the value object implements the SSLSessionBindingListener
interface, the object will receive a valueUnbound notification.
removeValue in interface SSLSessionname - the name of the link (no null are
accepted!)IllegalArgumentException - if the argument is null.protected void finalize()
throws Throwable
ObjectNote that objects that override finalize are significantly more expensive than
objects that don't. Finalizers may be run a long time after the object is no longer
reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup.
Note also that finalizers are run on a single VM-wide finalizer thread,
so doing blocking work in a finalizer is a bad idea. A finalizer is usually only necessary
for a class that has a native peer and needs to call a native method to destroy that peer.
Even then, it's better to provide an explicit close method (and implement
Closeable), and insist that callers manually dispose of instances. This
works well for something like files, but less well for something like a BigInteger
where typical calling code would have to deal with lots of temporaries. Unfortunately,
code that creates lots of temporaries is the worst kind of code from the point of view of
the single finalizer thread.
If you must use finalizers, consider at least providing your own
ReferenceQueue and having your own thread process that queue.
Unlike constructors, finalizers are not automatically chained. You are responsible for
calling super.finalize() yourself.
Uncaught exceptions thrown by finalizers are ignored and do not terminate the finalizer thread. See Effective Java Item 7, "Avoid finalizers" for more.