# `Latch.Identity`

Resolves an atproto handle to a verified identity.

Resolution is bidirectional per the atproto identity spec, the handle is
resolved to a DID and the DID document is fetched independently, and the
docment's claimed handle must match the handle we started from. Neither
direction alone is trusted, otherwise anyone could point DNS at a victim's
DID.

# `t`

```elixir
@type t() :: %Latch.Identity{
  did: String.t(),
  handle: String.t(),
  pds_endpoint: String.t()
}
```

# `resolve_did`

```elixir
@spec resolve_did(Latch.Config.t(), String.t()) ::
  {:ok, t()}
  | {:error,
     Latch.Error.HandleNotFound.t()
     | Latch.Error.IdentityMismatch.t()
     | Latch.Error.InvalidResponse.t()
     | Latch.Error.Transport.t()
     | Latch.Error.UnsupportedDIDMethod.t()}
```

Resolves and verifies a DID, returning the handle and PDS endpoint.

Returns structured `Latch.Error` exceptions describing resolution,
identity-verifiction, and transport failures.

# `resolve_handle`

```elixir
@spec resolve_handle(Latch.Config.t(), String.t()) ::
  {:ok, t()}
  | {:error,
     Latch.Error.HandleNotFound.t()
     | Latch.Error.IdentityMismatch.t()
     | Latch.Error.InvalidResponse.t()
     | Latch.Error.Transport.t()
     | Latch.Error.UnsupportedDIDMethod.t()}
```

Resolves and verifies a handle, returning its DID and PDS endpoint.

Returns structured `Latch.Error` exceptions describing resolution,
identity-verifiction, and transport failures.

---

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