# `Spectre.Definition.Candidate.Ref`
[🔗](https://github.com/elchemista/spectre/blob/0.3.0/lib/spectre/definition/candidate/ref.ex#L1)

Content-addressed identity of a bootstrap Definition Candidate.

A Candidate Ref is intentionally distinct from a `Definition.Ref`: it binds
the exact publication receipt and provenance proposed for activation, while
the Definition Ref continues to identify behavior bytes.

# `t`

```elixir
@type t() :: %Spectre.Definition.Candidate.Ref{algorithm: :sha256, digest: String.t()}
```

# `new`

```elixir
@spec new(Spectre.Definition.Candidate.t()) :: t()
```

Builds the Ref for a validated Candidate.

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, t()} | {:error, term()}
```

Parses the stable `candidate:sha256:<hex>` representation.

# `to_string`

```elixir
@spec to_string(t()) :: String.t()
```

Returns the stable textual representation.

# `valid?`

```elixir
@spec valid?(term()) :: boolean()
```

Checks the shape and supported digest algorithm.

# `verify`

```elixir
@spec verify(t(), Spectre.Definition.Candidate.t()) :: :ok | {:error, term()}
```

Verifies that a Ref addresses the supplied Candidate.

---

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