Struct ExternalGroup

Source
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 process_incoming_message_with_time( &mut self, message: MlsMessage, time: MlsTime, ) -> Result<ExternalReceivedMessage, MlsError>

Process an inbound message for this group, providing additional context with a message timestamp.

Providing a timestamp is useful when the IdentityProvider in use by the group can determine validity based on a timestamp. For example, this allows for checking X.509 certificate expiration at the time when message was received by a server rather than when a specific client asynchronously received message

See process_incoming_message for full details.

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 propose( &mut self, proposal: Proposal, authenticated_data: Vec<u8>, ) -> Result<MlsMessage, MlsError>

Issue an external proposal.

This function is useful for reissuing external proposals that are returned in crate::group::NewEpoch::unused_proposals after a commit is processed.

Source

pub fn clear_proposal_cache(&mut self)

Delete all sent and received proposals cached for commit.

Source

pub fn group_context(&self) -> &GroupContext

Get the current group context summarizing various information about 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 transcript_hash(&self) -> &Vec<u8>

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

Source

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

Get the tree 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.

Source

pub fn snapshot_without_ratchet_tree(&mut self) -> ExternalSnapshot

Create a snapshot of this group’s current internal state. The tree is not included in the state and can be stored separately by calling [Group::export_tree].

Trait Implementations§

Source§

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

Source§

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

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

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

§

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 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> ToOwned for T
where T: Clone,

Source§

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 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.