pub struct ExternalGroup<C>where
    C: ExternalClientConfig,{ /* private fields */ }
Available on crate feature external_client only.
Expand description

A handle to an observed group that can track plaintext control messages and the resulting group state.

Implementations§

source§

impl<C: ExternalClientConfig + Clone> ExternalGroup<C>

source

pub fn process_incoming_message( &mut self, message: MlsMessage ) -> Result<ExternalReceivedMessage, MlsError>

Process a message that was sent to the group.

  • Proposals will be stored in the group state and processed by the same rules as a standard group.

  • Commits will result in the same outcome as a standard group. However, the integrity of the resulting group state can only be partially verified, since the external group does have access to the group secrets required to do a complete check.

  • Application messages are always encrypted so they result in a no-op that returns ExternalReceivedMessage::Ciphertext

Warning

Processing an encrypted commit or proposal message has the same result as processing an encrypted application message. Proper tracking of the group state requires that all proposal and commit messages are readable.

source

pub fn insert_proposal_from_message( &mut self, message: MlsMessage ) -> Result<(), MlsError>

Replay a proposal message into the group skipping all validation steps.

source

pub fn insert_proposal(&mut self, proposal: CachedProposal)

Force insert a proposal directly into the internal state of the group with no validation.

source

pub fn propose_add( &mut self, key_package: MlsMessage, authenticated_data: Vec<u8> ) -> Result<MlsMessage, MlsError>

Create an external proposal to request that a group add a new member

Warning

In order for the proposal generated by this function to be successfully committed, the group needs to have signing_identity as an entry within an ExternalSendersExt as part of its group context extensions.

source

pub fn propose_remove( &mut self, index: u32, authenticated_data: Vec<u8> ) -> Result<MlsMessage, MlsError>

Create an external proposal to request that a group remove an existing member

Warning

In order for the proposal generated by this function to be successfully committed, the group needs to have signing_identity as an entry within an ExternalSendersExt as part of its group context extensions.

source

pub fn propose_external_psk( &mut self, psk: ExternalPskId, authenticated_data: Vec<u8> ) -> Result<MlsMessage, MlsError>

Create an external proposal to request that a group inserts an external pre shared key into its state.

Warning

In order for the proposal generated by this function to be successfully committed, the group needs to have signing_identity as an entry within an ExternalSendersExt as part of its group context extensions.

source

pub fn propose_resumption_psk( &mut self, psk_epoch: u64, authenticated_data: Vec<u8> ) -> Result<MlsMessage, MlsError>

Create an external proposal to request that a group adds a pre shared key from a previous epoch to the current group state.

Warning

In order for the proposal generated by this function to be successfully committed, the group needs to have signing_identity as an entry within an ExternalSendersExt as part of its group context extensions.

source

pub fn propose_group_context_extensions( &mut self, extensions: ExtensionList, authenticated_data: Vec<u8> ) -> Result<MlsMessage, MlsError>

Create an external proposal to request that a group sets extensions stored in the group state.

Warning

In order for the proposal generated by this function to be successfully committed, the group needs to have signing_identity as an entry within an ExternalSendersExt as part of its group context extensions.

source

pub fn propose_reinit( &mut self, group_id: Option<Vec<u8>>, version: ProtocolVersion, cipher_suite: CipherSuite, extensions: ExtensionList, authenticated_data: Vec<u8> ) -> Result<MlsMessage, MlsError>

Create an external proposal to request that a group is reinitialized.

Warning

In order for the proposal generated by this function to be successfully committed, the group needs to have signing_identity as an entry within an ExternalSendersExt as part of its group context extensions.

source

pub fn propose_custom( &mut self, proposal: CustomProposal, authenticated_data: Vec<u8> ) -> Result<MlsMessage, MlsError>

Create a custom proposal message.

Warning

In order for the proposal generated by this function to be successfully committed, the group needs to have signing_identity as an entry within an ExternalSendersExt as part of its group context extensions.

source

pub fn group_id(&self) -> &[u8]

Get the unique identifier of this group.

source

pub fn current_epoch(&self) -> u64

Get the current epoch number of the group’s state.

source

pub fn protocol_version(&self) -> ProtocolVersion

Get the current protocol version in use by the group.

source

pub fn cipher_suite(&self) -> CipherSuite

Get the current ciphersuite in use by the group.

source

pub fn export_tree(&self) -> Result<Vec<u8>, MlsError>

Export the current ratchet tree used within the group.

source

pub fn roster(&self) -> Roster<'_>

Get the current roster of the group.

source

pub fn context_extensions(&self) -> &ExtensionList

source

pub fn transcript_hash(&self) -> &Vec<u8>

Get the transcript hash for the current epoch that the group is in.

source

pub fn get_member_with_identity( &self, identity_id: &SigningIdentity ) -> Result<Member, MlsError>

Find a member based on their identity.

Identities are matched based on the IdentityProvider that this group was configured with.

source§

impl<C> ExternalGroup<C>where C: ExternalClientConfig + Clone,

source

pub fn snapshot(&self) -> ExternalSnapshot

Create a snapshot of this group’s current internal state.

Trait Implementations§

source§

impl<C> Clone for ExternalGroup<C>where C: ExternalClientConfig + Clone, C::CryptoProvider: Clone,

source§

fn clone(&self) -> ExternalGroup<C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<C> RefUnwindSafe for ExternalGroup<C>where C: RefUnwindSafe, <<C as ExternalClientConfig>::CryptoProvider as CryptoProvider>::CipherSuiteProvider: RefUnwindSafe,

§

impl<C> Send for ExternalGroup<C>

§

impl<C> Sync for ExternalGroup<C>

§

impl<C> Unpin for ExternalGroup<C>where C: Unpin, <<C as ExternalClientConfig>::CryptoProvider as CryptoProvider>::CipherSuiteProvider: Unpin,

§

impl<C> UnwindSafe for ExternalGroup<C>where C: UnwindSafe, <<C as ExternalClientConfig>::CryptoProvider as CryptoProvider>::CipherSuiteProvider: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.