BaileysEx.Signal.Identity (baileys_ex v0.1.0-alpha.8)

Copy Markdown View Source

Store-backed Signal identity helpers with TOFU and change detection semantics.

Identity keys are stored by canonical Signal address string in the :"identity-key" family. Raw 32-byte public keys are normalized to the Signal-prefixed 33-byte form before comparison and persistence.

Summary

Functions

Loads the peer identity key for an address from the active key store.

Trust-on-First-Use stores or verifies the peer identity for the specific Signal address string.

Types

error()

@type error() :: :invalid_identity_key

save_result()

@type save_result() :: :new | :unchanged | :changed

Functions

load(store, address)

@spec load(BaileysEx.Signal.Store.t(), BaileysEx.Signal.Address.t()) ::
  {:ok, binary() | nil}

Loads the peer identity key for an address from the active key store.

save(store, address, identity_key)

@spec save(BaileysEx.Signal.Store.t(), BaileysEx.Signal.Address.t(), binary()) ::
  {:ok, save_result()} | {:error, error()}

Trust-on-First-Use stores or verifies the peer identity for the specific Signal address string.