Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 22](https://developer.android.com/sdkExtensions) Summary: [Methods](https://developer.android.com/reference/android/net/ssl/EchConfigList#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/ssl/EchConfigList#inhmethods)

# EchConfigList

*** ** * ** ***


`
public


class
EchConfigList
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

<br />

*** ** * ** ***

Data used to configure ECH (Encrypted Client Hello) in a TLS handshake.

This object can only be constructed by feeding in the raw bytes of the EchConfigList from
a HTTPS DNS record (see https://datatracker.ietf.org/doc/html/rfc460), and may contain multiple
EchConfigs.

The general structure starts with the length of the EchConfigList (2 bytes), then each
entry in the list contains the following:

- Version: 2 bytes
- Length of the individual EchConfig: 2 bytes
- Contents: unspecified number of bytes

See https://datatracker.ietf.org/doc/draft-ietf-tls-esni for details of the exact structure.

## Summary

| ### Public methods ||
|---|---|
| ` static https://developer.android.com/reference/android/net/ssl/EchConfigList` | ` https://developer.android.com/reference/android/net/ssl/EchConfigList#fromBytes(byte[])(byte[] byteArr) ` Factory method to construct a new \[EchConfigList\] from a byte array. |
| ` byte[]` | ` https://developer.android.com/reference/android/net/ssl/EchConfigList#toBytes()() ` Returns the raw byte representation of an EchConfigList. |

| ### 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*. | ||

## Public methods

### fromBytes

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

```
public static EchConfigList fromBytes (byte[] byteArr)
```

Factory method to construct a new \[EchConfigList\] from a byte array.

The raw bytes from a HTTPS DNS record should be fed directly into this method.

<br />

| Parameters ||
|---|---|
| `byteArr` | `byte`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/ssl/EchConfigList` | This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/ssl/InvalidEchDataException` | if the ECH data is empty, does not contain a length, or has a length mismatch. |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `byteArr` is null. |

### toBytes

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

```
public byte[] toBytes ()
```

Returns the raw byte representation of an EchConfigList.

<br />

| Returns ||
|---|---|
| `byte[]` | This value cannot be `null`. <br /> |