Amarula.Protocol.Signal.Group.SenderKeyStore (amarula v0.1.0)

View Source

File-backed sender key store for group Signal sessions.

Mirrors SessionStore for 1:1 sessions. build/1 returns a store map with load_sender_key and store_sender_key function fields that GroupCipher and GroupSessionBuilder call. Each sender key is persisted via Amarula.Storage (the :sender_key namespace, keyed by the sender-key-name string), scoped to the connection conn (Amarula.Conn).

Summary

Functions

Build a store map bound to conn.

Load a SenderKeyRecord for sk_name on conn, or {:error, :not_found}.

Persist a SenderKeyRecord for sk_name on conn.

Functions

build(conn)

Build a store map bound to conn.

store = SenderKeyStore.build(conn)
{:ok, record} = store.load_sender_key(sk_name)
:ok = store.store_sender_key(sk_name, updated_record)

load_sender_key(conn, sk_name)

Load a SenderKeyRecord for sk_name on conn, or {:error, :not_found}.

store_sender_key(conn, sk_name, record)

Persist a SenderKeyRecord for sk_name on conn.