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

# SecureCacheResponse

` public abstract class SecureCacheResponse `   
` ` ` extends https://developer.android.com/reference/java/net/CacheResponse ` ` `

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [java.net.CacheResponse](https://developer.android.com/reference/java/net/CacheResponse) ||
|   | ↳ | java.net.SecureCacheResponse |

<br />

*** ** * ** ***

Represents a cache response originally retrieved through secure means, such as TLS.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/java/net/SecureCacheResponse#SecureCacheResponse()() ` |

| ### Public methods ||
|---|---|
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/net/SecureCacheResponse#getCipherSuite()() ` Returns the cipher suite in use on the original connection that retrieved the network resource. |
| ` abstract https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/security/cert/Certificate>` | ` https://developer.android.com/reference/java/net/SecureCacheResponse#getLocalCertificateChain()() ` Returns the certificate chain that were sent to the server during handshaking of the original connection that retrieved the network resource. |
| ` abstract https://developer.android.com/reference/java/security/Principal` | ` https://developer.android.com/reference/java/net/SecureCacheResponse#getLocalPrincipal()() ` Returns the principal that was sent to the server during handshaking in the original connection that retrieved the network resource. |
| ` abstract https://developer.android.com/reference/java/security/Principal` | ` https://developer.android.com/reference/java/net/SecureCacheResponse#getPeerPrincipal()() ` Returns the server's principal which was established as part of defining the session during the original connection that retrieved the network resource. |
| ` abstract https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/security/cert/Certificate>` | ` https://developer.android.com/reference/java/net/SecureCacheResponse#getServerCertificateChain()() ` Returns the server's certificate chain, which was established as part of defining the session in the original connection that retrieved the network resource, from cache. |

### Inherited methods

From class ` https://developer.android.com/reference/java/net/CacheResponse ` ` abstract https://developer.android.com/reference/java/io/InputStream` ` https://developer.android.com/reference/java/net/CacheResponse#getBody()() `

Returns the response body as an InputStream.
` abstract https://developer.android.com/reference/java/util/Map<https://developer.android.com/reference/java/lang/String, https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>>` ` https://developer.android.com/reference/java/net/CacheResponse#getHeaders()() `

Returns the response headers as a Map.
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*.

## Public constructors

### SecureCacheResponse

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

```
public SecureCacheResponse ()
```

<br />

<br />

## Public methods

### getCipherSuite

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

```
public abstract String getCipherSuite ()
```

Returns the cipher suite in use on the original connection that retrieved the network resource.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representing the cipher suite <br /> |

### getLocalCertificateChain

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

```
public abstract List<Certificate> getLocalCertificateChain ()
```

Returns the certificate chain that were sent to the server during handshaking of the original connection that retrieved the network resource. Note: This method is useful only when using certificate-based cipher suites.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/security/cert/Certificate>` | an immutable List of Certificate representing the certificate chain that was sent to the server. If no certificate chain was sent, null will be returned. <br /> |

**See also:**

- `https://developer.android.com/reference/java/net/SecureCacheResponse#getLocalPrincipal()`

### getLocalPrincipal

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

```
public abstract Principal getLocalPrincipal ()
```

Returns the principal that was sent to the server during handshaking in the original connection that retrieved the network resource.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/Principal` | the principal sent to the server. Returns an X500Principal of the end-entity certificate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites. If no principal was sent, then null is returned. <br /> |

**See also:**

- `https://developer.android.com/reference/java/net/SecureCacheResponse#getLocalCertificateChain()`
- `https://developer.android.com/reference/java/net/SecureCacheResponse#getPeerPrincipal()`

### getPeerPrincipal

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

```
public abstract Principal getPeerPrincipal ()
```

Returns the server's principal which was established as part of defining the session during the original connection that retrieved the network resource.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/Principal` | the server's principal. Returns an X500Principal of the end-entity certiticate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/javax/net/ssl/SSLPeerUnverifiedException` | if the peer was not verified. |

**See also:**

- `https://developer.android.com/reference/java/net/SecureCacheResponse#getServerCertificateChain()`
- `https://developer.android.com/reference/java/net/SecureCacheResponse#getLocalPrincipal()`

### getServerCertificateChain

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

```
public abstract List<Certificate> getServerCertificateChain ()
```

Returns the server's certificate chain, which was established as part of defining the session in the original connection that retrieved the network resource, from cache. Note: This method can be used only when using certificate-based cipher suites; using it with non-certificate-based cipher suites, such as Kerberos, will throw an SSLPeerUnverifiedException.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/security/cert/Certificate>` | an immutable List of Certificate representing the server's certificate chain. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/javax/net/ssl/SSLPeerUnverifiedException` | if the peer is not verified. |

**See also:**

- `https://developer.android.com/reference/java/net/SecureCacheResponse#getPeerPrincipal()`