Struct MessageGroup

Source
pub struct MessageGroup<ID, OP, PKI, DGM, KMG, ORD> { /* private fields */ }
Expand description

API to manage groups using the “Message Encryption” scheme with strong security guarantees.

Implementations§

Source§

impl<ID, OP, PKI, DGM, KMG, ORD> MessageGroup<ID, OP, PKI, DGM, KMG, ORD>
where ID: IdentityHandle, OP: OperationId, PKI: IdentityRegistry<ID, PKI::State> + PreKeyRegistry<ID, OneTimeKeyBundle>, PKI::State: Clone, DGM: AckedGroupMembership<ID, OP>, KMG: IdentityManager<KMG::State> + PreKeyManager, KMG::State: Clone, ORD: ForwardSecureOrdering<ID, OP, DGM>,

Source

pub fn init( my_id: ID, my_keys: KMG::State, pki: PKI::State, dgm: DGM::State, orderer: ORD::State, config: GroupConfig, ) -> GroupState<ID, OP, PKI, DGM, KMG, ORD>

Returns initial state for messaging group.

This needs to be called before creating or being added to a group.

Source

pub fn create( y: GroupState<ID, OP, PKI, DGM, KMG, ORD>, initial_members: Vec<ID>, rng: &Rng, ) -> GroupResult<ORD::Message, ID, OP, PKI, DGM, KMG, ORD>

Creates new group with initial set of members.

Source

pub fn add( y: GroupState<ID, OP, PKI, DGM, KMG, ORD>, added: ID, rng: &Rng, ) -> GroupResult<ORD::Message, ID, OP, PKI, DGM, KMG, ORD>

Adds new member to group.

Source

pub fn remove( y: GroupState<ID, OP, PKI, DGM, KMG, ORD>, removed: ID, rng: &Rng, ) -> GroupResult<ORD::Message, ID, OP, PKI, DGM, KMG, ORD>

Removes member from group. It is possible to remove ourselves.

Source

pub fn update( y: GroupState<ID, OP, PKI, DGM, KMG, ORD>, rng: &Rng, ) -> GroupResult<ORD::Message, ID, OP, PKI, DGM, KMG, ORD>

Updates group secret and provides all members with fresh entropy.

Source

pub fn receive( y: GroupState<ID, OP, PKI, DGM, KMG, ORD>, message: &ORD::Message, rng: &Rng, ) -> GroupResult<Option<GroupOutput<ID, OP, DGM, ORD>>, ID, OP, PKI, DGM, KMG, ORD>

Handler for incoming, remote messages.

This yields a list of “outputs” which can be either control messages which need to be broadcast to all members in the group or decrypted application message payloads.

If we got removed after processing a control message we will receive a “removed” output signal.

Source

pub fn send( y: GroupState<ID, OP, PKI, DGM, KMG, ORD>, plaintext: &[u8], ) -> GroupResult<ORD::Message, ID, OP, PKI, DGM, KMG, ORD>

Encrypts application message towards the current group.

The returned message can then be broadcast to all members in the group. The underlying protocol makes sure that all members will be able to decrypt this message.

Source

pub fn members( y: &GroupState<ID, OP, PKI, DGM, KMG, ORD>, ) -> Result<HashSet<ID>, GroupError<ID, OP, PKI, DGM, KMG, ORD>>

Returns a list of all current members in this group from our perspective.

Auto Trait Implementations§

§

impl<ID, OP, PKI, DGM, KMG, ORD> Freeze for MessageGroup<ID, OP, PKI, DGM, KMG, ORD>

§

impl<ID, OP, PKI, DGM, KMG, ORD> RefUnwindSafe for MessageGroup<ID, OP, PKI, DGM, KMG, ORD>

§

impl<ID, OP, PKI, DGM, KMG, ORD> Send for MessageGroup<ID, OP, PKI, DGM, KMG, ORD>
where ID: Send, OP: Send, PKI: Send, DGM: Send, KMG: Send, ORD: Send,

§

impl<ID, OP, PKI, DGM, KMG, ORD> Sync for MessageGroup<ID, OP, PKI, DGM, KMG, ORD>
where ID: Sync, OP: Sync, PKI: Sync, DGM: Sync, KMG: Sync, ORD: Sync,

§

impl<ID, OP, PKI, DGM, KMG, ORD> Unpin for MessageGroup<ID, OP, PKI, DGM, KMG, ORD>
where ID: Unpin, OP: Unpin, PKI: Unpin, DGM: Unpin, KMG: Unpin, ORD: Unpin,

§

impl<ID, OP, PKI, DGM, KMG, ORD> UnwindSafe for MessageGroup<ID, OP, PKI, DGM, KMG, ORD>
where ID: UnwindSafe, OP: UnwindSafe, PKI: UnwindSafe, DGM: UnwindSafe, KMG: UnwindSafe, ORD: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V