Struct EncryptionGroup

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

API to manage groups using the “Data Encryption” scheme and process remote control messages.

Implementations§

Source§

impl<ID, OP, PKI, DGM, KMG, ORD> EncryptionGroup<ID, OP, PKI, DGM, KMG, ORD>
where ID: IdentityHandle, OP: OperationId, PKI: IdentityRegistry<ID, PKI::State> + PreKeyRegistry<ID, LongTermKeyBundle>, PKI::State: Clone, DGM: GroupMembership<ID, OP>, KMG: IdentityManager<KMG::State> + PreKeyManager, KMG::State: Clone, ORD: Ordering<ID, OP, DGM>,

Source

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

Returns initial state for 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 by providing all current members with new group secret.

Source

pub fn receive( y: GroupState<ID, OP, PKI, DGM, KMG, ORD>, message: &ORD::Message, ) -> GroupResult<Vec<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 payloads.

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

Source

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

Encrypts application payload 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.

Source

pub fn update_secrets<F>( y: GroupState<ID, OP, PKI, DGM, KMG, ORD>, update_fn: F, ) -> GroupState<ID, OP, PKI, DGM, KMG, ORD>

Applications can remove group secrets for forward secrecy based on their own logic.

Make sure that the ordering implementation and higher-level application logic accounts for error cases where past secrets might not exist anymore.

Auto Trait Implementations§

§

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

§

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

§

impl<ID, OP, PKI, DGM, KMG, ORD> Send for EncryptionGroup<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 EncryptionGroup<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 EncryptionGroup<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 EncryptionGroup<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