Spectre.Experience.Evidence.Ref (Spectre v0.3.0)

Copy Markdown View Source

Content-addressed identity of redacted Experience evidence.

Summary

Functions

Builds a Ref for validated Experience evidence.

Parses the canonical experience:sha256:<lowercase hex> representation.

Returns the canonical textual representation.

Checks the Ref algorithm and lowercase digest shape.

Verifies that a Ref addresses the supplied evidence.

Types

t()

@type t() :: %Spectre.Experience.Evidence.Ref{algorithm: :sha256, digest: String.t()}

Functions

new(evidence)

@spec new(Spectre.Experience.Evidence.t()) :: t()

Builds a Ref for validated Experience evidence.

parse(value)

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

Parses the canonical experience:sha256:<lowercase hex> representation.

to_string(ref)

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

Returns the canonical textual representation.

valid?(arg1)

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

Checks the Ref algorithm and lowercase digest shape.

verify(expected, evidence)

@spec verify(t(), Spectre.Experience.Evidence.t()) :: :ok | {:error, term()}

Verifies that a Ref addresses the supplied evidence.