Package: org.conscrypt

EchConfigList

public class EchConfigList
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:

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

Public Methods

fromBytes

public static EchConfigList fromBytes(byte[] byteArr) throws org.conscrypt.InvalidEchDataException
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.

Throws
NullPointerException if byteArr is null.
InvalidEchDataException if the ECH data is empty, does not contain a length, or has a length mismatch.

toBytes

public byte[] toBytes()
Returns the raw byte representation of an EchConfigList.