# `SSL.Protocol.HandshakeMachine`
[🔗](https://github.com/gsmlg-dev/http_fetch/blob/v0.16.7/apps/ex_ssl/lib/ssl/protocol/handshake_machine.ex#L1)

Pure TLS client coordinator consuming one complete record at a time.

# `event`

```elixir
@type event() ::
  {:connected, binary() | nil} | {:application_data, binary()} | :closed
```

# `t`

```elixir
@type t() ::
  %SSL.Protocol.HandshakeMachine{
    client_ast: term(),
    client_hello: term(),
    client_identity: term(),
    enable_tickets: term(),
    framer: term(),
    hrr: term(),
    hrr_transcript: term(),
    identity: term(),
    key_pair: term(),
    key_pairs: term(),
    negotiated_protocol: term(),
    offer: term(),
    options: term(),
    pending_tickets: term(),
    phase: term(),
    read_state: term(),
    resumed: term(),
    resumption_master: term(),
    server_hello: term(),
    ticket: term(),
    ticket_count: term(),
    trust_source: term(),
    verified_peer: term(),
    verifier: term(),
    write_state: term()
  }
  | SSL.Protocol.TLS12.t()
```

# `encrypt`

```elixir
@spec encrypt(t(), :application_data | :alert, iodata()) ::
  {:ok, binary(), t()} | {:error, term()}
```

# `feed`

```elixir
@spec feed(t(), binary()) ::
  {:ok, t(), [binary()], [event()]}
  | {:error, {:fatal_alert, atom(), term()} | {:peer_alert, byte(), byte()}}
```

# `init`

```elixir
@spec init(
  SSL.ClientHello.Materializer.Materialized.t(),
  term(),
  SSL.PKIX.identity(),
  keyword()
) ::
  {:ok, t(), [binary()]} | {:error, term()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
