Skip to content

Most visited

Recently visited

navigation
Added in API level 1

SSLSession

public interface SSLSession

javax.net.ssl.SSLSession


The interface representing an SSL session.

Summary

Public methods

abstract int getApplicationBufferSize()

Returns the maximum size that an application buffer can be for this session.

abstract String getCipherSuite()

Returns the name of the cipher suite used in this session.

abstract long getCreationTime()

Returns the time this session was created, in milliseconds since midnight January 1st 1970 UTC.

abstract byte[] getId()

Returns this sessions identifier.

abstract long getLastAccessedTime()

Returns the time this session was last accessed, in milliseconds since midnight January 1st 1970 UTC.

abstract Certificate[] getLocalCertificates()

Returns the list of certificates that were used to identify the local side to the peer during the handshake.

abstract Principal getLocalPrincipal()

Returns the principal used to identify the local side to the peer during the handshake.

abstract int getPacketBufferSize()

Returns the maximum size that a network buffer can be for this session.

abstract X509Certificate[] getPeerCertificateChain()

Returns the list of certificates the peer used to identify itself during the handshake.

abstract Certificate[] getPeerCertificates()

Returns the list of certificates the peer used to identify itself during the handshake.

abstract String getPeerHost()

Returns the host name of the peer of this session.

abstract int getPeerPort()

Returns the port number of the peer of this session.

abstract Principal getPeerPrincipal()

Returns the principal identifying the peer during the handshake.

abstract String getProtocol()

Returns the protocol name that is used for all connections in this session.

abstract SSLSessionContext getSessionContext()

Returns the context of this session, or null if no context is available.

abstract Object getValue(String name)

Returns the object bound to the specified name in this session's application layer data.

abstract String[] getValueNames()

Returns the list of the object names bound to this session's application layer data..

abstract void invalidate()

Invalidates this session.

abstract boolean isValid()

Returns whether this session is valid.

abstract void putValue(String name, Object value)

Binds the specified object under the specified name in this session's application layer data.

abstract void removeValue(String name)

Removes the binding for the specified name in this session's application layer data.

Public methods

getApplicationBufferSize

Added in API level 1
int getApplicationBufferSize ()

Returns the maximum size that an application buffer can be for this session.

Returns
int the maximum application buffer size.

getCipherSuite

Added in API level 1
String getCipherSuite ()

Returns the name of the cipher suite used in this session.

Returns
String the name of the cipher suite used in this session.

getCreationTime

Added in API level 1
long getCreationTime ()

Returns the time this session was created, in milliseconds since midnight January 1st 1970 UTC.

Returns
long the time the session was created.

getId

Added in API level 1
byte[] getId ()

Returns this sessions identifier.

Returns
byte[] this sessions identifier.

getLastAccessedTime

Added in API level 1
long getLastAccessedTime ()

Returns the time this session was last accessed, in milliseconds since midnight January 1st 1970 UTC.

Returns
long the time this session was last accessed.

getLocalCertificates

Added in API level 1
Certificate[] getLocalCertificates ()

Returns the list of certificates that were used to identify the local side to the peer during the handshake.

Returns
Certificate[] the list of certificates, ordered from local certificate to CA's certificates.

getLocalPrincipal

Added in API level 1
Principal getLocalPrincipal ()

Returns the principal used to identify the local side to the peer during the handshake.

Returns
Principal the principal used to identify the local side.

getPacketBufferSize

Added in API level 1
int getPacketBufferSize ()

Returns the maximum size that a network buffer can be for this session.

Returns
int the maximum network buffer size.

getPeerCertificateChain

Added in API level 1
X509Certificate[] getPeerCertificateChain ()

Returns the list of certificates the peer used to identify itself during the handshake.

Note: this method exists for compatility reasons, use getPeerCertificates() instead.

Returns
X509Certificate[] the list of certificates, ordered from the identity certificate to the CA's certificates
Throws
SSLPeerUnverifiedException if the identity of the peer is not verified.

getPeerCertificates

Added in API level 1
Certificate[] getPeerCertificates ()

Returns the list of certificates the peer used to identify itself during the handshake.

Returns
Certificate[] the list of certificates, ordered from the identity certificate to the CA's certificates.
Throws
SSLPeerUnverifiedException if the identity of the peer is not verified.

getPeerHost

Added in API level 1
String getPeerHost ()

Returns the host name of the peer of this session. The host name is not authenticated.

Returns
String the host name of the peer of this session, or null if no host name is available.

getPeerPort

Added in API level 1
int getPeerPort ()

Returns the port number of the peer of this session. The port number is not authenticated.

Returns
int the port number of the peer, of -1 is no port number is available.

getPeerPrincipal

Added in API level 1
Principal getPeerPrincipal ()

Returns the principal identifying the peer during the handshake.

Returns
Principal the principal identifying the peer.
Throws
SSLPeerUnverifiedException if the identity of the peer has not been verified.

getProtocol

Added in API level 1
String getProtocol ()

Returns the protocol name that is used for all connections in this session.

Returns
String the protocol name that is used for all connections in this session.

getSessionContext

Added in API level 1
SSLSessionContext getSessionContext ()

Returns the context of this session, or null if no context is available.

Returns
SSLSessionContext

getValue

Added in API level 1
Object getValue (String name)

Returns the object bound to the specified name in this session's application layer data.

Parameters
name String: the name of the bound value.
Returns
Object the value bound to the specified name, or null if the specified name does not exist or is not accessible in the current access control context.
Throws
IllegalArgumentException if name is null.

getValueNames

Added in API level 1
String[] getValueNames ()

Returns the list of the object names bound to this session's application layer data..

Depending on the current access control context, the list of object names may be different.

Returns
String[] the list of the object names bound to this session's application layer data.

invalidate

Added in API level 1
void invalidate ()

Invalidates this session.

No new connections can be created, but any existing connection remains valid until it is closed.

isValid

Added in API level 1
boolean isValid ()

Returns whether this session is valid.

Returns
boolean true if this session is valid, otherwise false.

putValue

Added in API level 1
void putValue (String name, 
                Object value)

Binds the specified object under the specified name in this session's application layer data.

For bindings (new or existing) implementing the SSLSessionBindingListener interface the object will be notified.

Parameters
name String: the name to bind the object to.
value Object: the object to bind.
Throws
IllegalArgumentException if either name or value is null.

removeValue

Added in API level 1
void removeValue (String name)

Removes the binding for the specified name in this session's application layer data. If the existing binding implements the SSLSessionBindingListener interface the object will be notified.

Parameters
name String: the binding to remove.
Throws
IllegalArgumentException if name is null.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.