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

View Source

Group Session Builder for Signal Protocol.

This module handles the creation and processing of sender key distribution messages for group encryption sessions.

Summary

Functions

Creates a new GroupSessionBuilder.

Types

t()

@type t() :: %Amarula.Protocol.Signal.Group.GroupSessionBuilder{
  sender_key_store: module()
}

Functions

create_sender_key_distribution_message(builder, sender_key_store, group_id, me_id)

@spec create_sender_key_distribution_message(t(), map(), String.t(), String.t()) ::
  {:ok, Amarula.Protocol.Signal.Group.SenderKeyDistributionMessage.t()}
  | {:error, String.t()}

Creates a sender key distribution message.

new(sender_key_store)

@spec new(module()) :: t()

Creates a new GroupSessionBuilder.

process_sender_key_distribution_message(builder, sender_key_store, item, author_jid)

@spec process_sender_key_distribution_message(t(), map(), struct(), String.t()) ::
  :ok | {:error, String.t()}

Process an incoming sender key distribution message.

store is a map with load_sender_key and store_sender_key fn fields (as returned by SenderKeyStore.build/1).

item is a Proto.Message.SenderKeyDistributionMessage struct with groupId (string) and axolotlSenderKeyDistributionMessage (raw proto bytes).