Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/javax/net/ssl/ExtendedSSLSession#pubctors) \| [Methods](https://developer.android.com/reference/javax/net/ssl/ExtendedSSLSession#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/javax/net/ssl/ExtendedSSLSession#inhmethods)

# ExtendedSSLSession

` public abstract class ExtendedSSLSession `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/javax/net/ssl/SSLSession `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | javax.net.ssl.ExtendedSSLSession |

<br />

*** ** * ** ***

Extends the `SSLSession` interface to support additional session attributes.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/javax/net/ssl/ExtendedSSLSession#ExtendedSSLSession()() ` Constructor for subclasses to call. |

| ### Public methods ||
|---|---|
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/javax/net/ssl/ExtendedSSLSession#getLocalSupportedSignatureAlgorithms()() ` Obtains an array of supported signature algorithms that the local side is willing to use. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/javax/net/ssl/ExtendedSSLSession#getPeerSupportedSignatureAlgorithms()() ` Obtains an array of supported signature algorithms that the peer is able to use. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/javax/net/ssl/SNIServerName>` | ` https://developer.android.com/reference/javax/net/ssl/ExtendedSSLSession#getRequestedServerNames()() ` Obtains a `https://developer.android.com/reference/java/util/List` containing all `https://developer.android.com/reference/javax/net/ssl/SNIServerName`s of the requested Server Name Indication (SNI) extension. |
| ` https://developer.android.com/reference/java/util/List<byte[]>` | ` https://developer.android.com/reference/javax/net/ssl/ExtendedSSLSession#getStatusResponses()() ` Returns a `https://developer.android.com/reference/java/util/List` containing DER-encoded OCSP responses (using the ASN.1 type OCSPResponse defined in RFC 6960) for the client to verify status of the server's certificate during handshaking. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/javax/net/ssl/SSLSession ` ` abstract int` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getApplicationBufferSize()() `

Gets the current size of the largest application data that is expected when using this session.
` abstract https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getCipherSuite()() `

Returns the name of the SSL cipher suite which is used for all connections in the session.
` abstract long` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getCreationTime()() `

Returns the time at which this Session representation was created, in milliseconds since midnight, January 1, 1970 UTC.
` abstract byte[]` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getId()() `

Returns the identifier assigned to this Session.
` abstract long` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getLastAccessedTime()() `

Returns the last time this Session representation was accessed by the session level infrastructure, in milliseconds since midnight, January 1, 1970 UTC.
` abstract https://developer.android.com/reference/java/security/cert/Certificate` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getLocalCertificates()() `

Returns the certificate(s) that were sent to the peer during handshaking.
` abstract https://developer.android.com/reference/java/security/Principal` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getLocalPrincipal()() `

Returns the principal that was sent to the peer during handshaking.
` abstract int` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getPacketBufferSize()() `

Gets the current size of the largest SSL/TLS packet that is expected when using this session.
` abstract https://developer.android.com/reference/javax/security/cert/X509Certificate` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getPeerCertificateChain()() `

Returns the identity of the peer which was identified as part of defining the session.
` abstract https://developer.android.com/reference/java/security/cert/Certificate` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getPeerCertificates()() `

Returns the identity of the peer which was established as part of defining the session.
` abstract https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getPeerHost()() `

Returns the host name of the peer in this session.
` abstract int` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getPeerPort()() `

Returns the port number of the peer in this session.
` abstract https://developer.android.com/reference/java/security/Principal` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getPeerPrincipal()() `

Returns the identity of the peer which was established as part of defining the session.
` abstract https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getProtocol()() `

Returns the standard name of the protocol used for all connections in the session.
` abstract https://developer.android.com/reference/javax/net/ssl/SSLSessionContext` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getSessionContext()() `

Returns the context in which this session is bound.
` abstract https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getValue(java.lang.String)(https://developer.android.com/reference/java/lang/String name) `

Returns the object bound to the given name in the session's application layer data.
` abstract https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#getValueNames()() `

Returns an array of the names of all the application layer data objects bound into the Session.
` abstract void` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#invalidate()() `

Invalidates the session.
` abstract boolean` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#isValid()() `

Returns whether this session is valid and available for resuming or joining.
` abstract void` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#putValue(java.lang.String,%20java.lang.Object)(https://developer.android.com/reference/java/lang/String name, https://developer.android.com/reference/java/lang/Object value) `

Binds the specified `value` object into the session's application layer data with the given `name`.
` abstract void` ` https://developer.android.com/reference/javax/net/ssl/SSLSession#removeValue(java.lang.String)(https://developer.android.com/reference/java/lang/String name) `

Removes the object bound to the given name in the session's application layer data.

## Public constructors

### ExtendedSSLSession

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ExtendedSSLSession ()
```

Constructor for subclasses to call.

<br />

## Public methods

### getLocalSupportedSignatureAlgorithms

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract String[] getLocalSupportedSignatureAlgorithms ()
```

Obtains an array of supported signature algorithms that the local side is willing to use.

Note: this method is used to indicate to the peer which signature algorithms may be used for digital signatures in TLS/DTLS 1.2. It is not meaningful for TLS/DTLS versions prior to 1.2.

The signature algorithm name must be a standard Java Security name (such as "SHA1withRSA", "SHA256withECDSA", and so on). See the [Java Security Standard Algorithm Names](https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html) document for information about standard algorithm names.

Note: the local supported signature algorithms should conform to the algorithm constraints specified by `https://developer.android.com/reference/javax/net/ssl/SSLParameters#getAlgorithmConstraints()` method in `SSLParameters`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | An array of supported signature algorithms, in descending order of preference. The return value is an empty array if no signature algorithm is supported. <br /> |

**See also:**

- `https://developer.android.com/reference/javax/net/ssl/SSLParameters#getAlgorithmConstraints()`

### getPeerSupportedSignatureAlgorithms

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract String[] getPeerSupportedSignatureAlgorithms ()
```

Obtains an array of supported signature algorithms that the peer is able to use.

Note: this method is used to indicate to the local side which signature algorithms may be used for digital signatures in TLS/DTLS 1.2. It is not meaningful for TLS/DTLS versions prior to 1.2.

The signature algorithm name must be a standard Java Security name (such as "SHA1withRSA", "SHA256withECDSA", and so on). See the [Java Security Standard Algorithm Names](https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html) document for information about standard algorithm names.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | An array of supported signature algorithms, in descending order of preference. The return value is an empty array if the peer has not sent the supported signature algorithms. <br /> |

**See also:**

- `https://developer.android.com/reference/javax/net/ssl/X509KeyManager`
- `https://developer.android.com/reference/javax/net/ssl/X509ExtendedKeyManager`

### getRequestedServerNames

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<SNIServerName> getRequestedServerNames ()
```

Obtains a `https://developer.android.com/reference/java/util/List` containing all `https://developer.android.com/reference/javax/net/ssl/SNIServerName`s of the requested Server Name Indication (SNI) extension.

In server mode, unless the return `https://developer.android.com/reference/java/util/List` is empty, the server should use the requested server names to guide its selection of an appropriate authentication certificate, and/or other aspects of security policy.

In client mode, unless the return `https://developer.android.com/reference/java/util/List` is empty, the client should use the requested server names to guide its endpoint identification of the peer's identity, and/or other aspects of security policy.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/javax/net/ssl/SNIServerName>` | a non-null immutable list of `https://developer.android.com/reference/javax/net/ssl/SNIServerName`s of the requested server name indications. The returned list may be empty if no server name indications were requested. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | if the underlying provider does not implement the operation |

**See also:**

- `https://developer.android.com/reference/javax/net/ssl/SNIServerName`
- `https://developer.android.com/reference/javax/net/ssl/X509ExtendedTrustManager`
- `https://developer.android.com/reference/javax/net/ssl/X509ExtendedKeyManager`

### getStatusResponses

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<byte[]> getStatusResponses ()
```

Returns a `https://developer.android.com/reference/java/util/List` containing DER-encoded OCSP responses (using the ASN.1 type OCSPResponse defined in RFC 6960) for the client to verify status of the server's certificate during handshaking.

This method only applies to certificate-based server authentication. An `https://developer.android.com/reference/javax/net/ssl/X509ExtendedTrustManager` will use the returned value for server certificate validation.

<br />

##### Implementation Requirements:

- This method throws UnsupportedOperationException by default. Classes derived from ExtendedSSLSession must implement this method.

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<byte[]>` | a non-null unmodifiable list of byte arrays, each entry containing a DER-encoded OCSP response (using the ASN.1 type OCSPResponse defined in RFC 6960). The order of the responses must match the order of the certificates presented by the server in its Certificate message (See `https://developer.android.com/reference/javax/net/ssl/SSLSession#getLocalCertificates()` for server mode, and `https://developer.android.com/reference/javax/net/ssl/SSLSession#getPeerCertificates()` for client mode). It is possible that fewer response entries may be returned than the number of presented certificates. If an entry in the list is a zero-length byte array, it should be treated by the caller as if the OCSP entry for the corresponding certificate is missing. The returned list may be empty if no OCSP responses were presented during handshaking or if OCSP stapling is not supported by either endpoint for this handshake. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | if the underlying provider does not implement the operation |

**See also:**

- `https://developer.android.com/reference/javax/net/ssl/X509ExtendedTrustManager`