A versioned, domain-separated content identity.
Identities contain the complete scheme and domain alongside the digest. Two
equal digest byte strings in different domains are therefore different keys.
Use digest/2 for canonical identity documents and derive/2 for identities
derived from ordered causal coordinates.
Summary
Functions
Derives an identity from an ordered collection of identities and scalars.
Builds a SHA-256 identity from a canonical identity document.
Builds an identity from bytes already encoded with the canonical codec.
Returns the registered identity domains.
Builds an identity from a value's explicit portable projection.
Returns a bounded display string. It must not be used for lookup.
Returns the compact binary form used inside canonical identity documents.
Returns the full tagged text representation of an identity.
Verifies that an identity document reproduces the expected identity.
Verifies an identity document, raising on mismatch.
Types
@type domain() ::
:component_definition
| :node_occurrence
| :connection_definition
| :workflow_artifact
| :payload
| :fact_content
| :fact_occurrence
| :execution
| :input_command
| :activation
| :attempt
| :transaction
| :event
| :event_data
| :snapshot
| :segment
A registered identity domain.
@type t() :: %Runic.Identity{ digest: <<_::256>>, domain: domain(), scheme: :sha256, version: 1 }
Functions
Derives an identity from an ordered collection of identities and scalars.
Builds a SHA-256 identity from a canonical identity document.
Builds an identity from bytes already encoded with the canonical codec.
@spec domains() :: [domain()]
Returns the registered identity domains.
Builds an identity from a value's explicit portable projection.
@spec short_string(t(), pos_integer()) :: String.t()
Returns a bounded display string. It must not be used for lookup.
Returns the compact binary form used inside canonical identity documents.
Returns the full tagged text representation of an identity.
@spec verify(t(), term()) :: :ok | {:error, Runic.Identity.IntegrityError.t()}
Verifies that an identity document reproduces the expected identity.
Verifies an identity document, raising on mismatch.