Amarula.Protocol.Signal.Group.SenderKeyState (amarula v0.1.0)
View SourceRepresents the state of a sender key for group encryption.
Manages the sender chain key, signing key, and message keys for a specific sender.
Summary
Functions
Adds a sender message key to the state.
Gets the sender key ID.
Gets the current sender chain key.
Gets the private signing key.
Gets the public signing key.
Checks if a message key exists for the given iteration.
Creates a new SenderKeyState.
Removes and returns a sender message key for the given iteration.
Sets the sender chain key.
Checks if the state is valid.
Types
@type t() :: %Amarula.Protocol.Signal.Group.SenderKeyState{ sender_chain_key: Amarula.Protocol.Signal.Group.SenderChainKey.t(), sender_key_id: non_neg_integer(), sender_message_keys: [Amarula.Protocol.Signal.Group.SenderMessageKey.t()], sender_signing_key: signing_key() }
Functions
@spec add_sender_message_key(t(), Amarula.Protocol.Signal.Group.SenderMessageKey.t()) :: t()
Adds a sender message key to the state.
@spec get_key_id(t()) :: non_neg_integer()
Gets the sender key ID.
@spec get_sender_chain_key(t()) :: Amarula.Protocol.Signal.Group.SenderChainKey.t()
Gets the current sender chain key.
Gets the private signing key.
Gets the public signing key.
@spec has_sender_message_key(t(), non_neg_integer()) :: boolean()
Checks if a message key exists for the given iteration.
@spec new(non_neg_integer(), non_neg_integer(), binary(), signing_key()) :: t()
Creates a new SenderKeyState.
@spec remove_sender_message_key(t(), non_neg_integer()) :: {Amarula.Protocol.Signal.Group.SenderMessageKey.t() | nil, t()}
Removes and returns a sender message key for the given iteration.
@spec set_sender_chain_key(t(), Amarula.Protocol.Signal.Group.SenderChainKey.t()) :: t()
Sets the sender chain key.
Checks if the state is valid.