pub struct ExternalGroup<C>where
C: ExternalClientConfig,{ /* private fields */ }
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>
impl<C: ExternalClientConfig + Clone> ExternalGroup<C>
Sourcepub fn process_incoming_message(
&mut self,
message: MlsMessage,
) -> Result<ExternalReceivedMessage, MlsError>
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.
Sourcepub fn process_incoming_message_with_time(
&mut self,
message: MlsMessage,
time: MlsTime,
) -> Result<ExternalReceivedMessage, MlsError>
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.
Sourcepub fn insert_proposal_from_message(
&mut self,
message: MlsMessage,
) -> Result<(), MlsError>
pub fn insert_proposal_from_message( &mut self, message: MlsMessage, ) -> Result<(), MlsError>
Replay a proposal message into the group skipping all validation steps.
Sourcepub fn insert_proposal(&mut self, proposal: CachedProposal)
pub fn insert_proposal(&mut self, proposal: CachedProposal)
Force insert a proposal directly into the internal state of the group with no validation.
Sourcepub fn propose_add(
&mut self,
key_package: MlsMessage,
authenticated_data: Vec<u8>,
) -> Result<MlsMessage, MlsError>
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.
Sourcepub fn propose_remove(
&mut self,
index: u32,
authenticated_data: Vec<u8>,
) -> Result<MlsMessage, MlsError>
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.
Sourcepub fn propose_external_psk(
&mut self,
psk: ExternalPskId,
authenticated_data: Vec<u8>,
) -> Result<MlsMessage, MlsError>
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.
Sourcepub fn propose_resumption_psk(
&mut self,
psk_epoch: u64,
authenticated_data: Vec<u8>,
) -> Result<MlsMessage, MlsError>
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.
Sourcepub fn propose_group_context_extensions(
&mut self,
extensions: ExtensionList,
authenticated_data: Vec<u8>,
) -> Result<MlsMessage, MlsError>
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.
Sourcepub fn propose_reinit(
&mut self,
group_id: Option<Vec<u8>>,
version: ProtocolVersion,
cipher_suite: CipherSuite,
extensions: ExtensionList,
authenticated_data: Vec<u8>,
) -> Result<MlsMessage, MlsError>
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.
Sourcepub fn propose_custom(
&mut self,
proposal: CustomProposal,
authenticated_data: Vec<u8>,
) -> Result<MlsMessage, MlsError>
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.
Sourcepub fn propose(
&mut self,
proposal: Proposal,
authenticated_data: Vec<u8>,
) -> Result<MlsMessage, MlsError>
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.
Sourcepub fn clear_proposal_cache(&mut self)
pub fn clear_proposal_cache(&mut self)
Delete all sent and received proposals cached for commit.
Sourcepub fn group_context(&self) -> &GroupContext
pub fn group_context(&self) -> &GroupContext
Get the current group context summarizing various information about the group.
Sourcepub fn export_tree(&self) -> Result<Vec<u8>, MlsError>
pub fn export_tree(&self) -> Result<Vec<u8>, MlsError>
Export the current ratchet tree used within the group.
Sourcepub fn transcript_hash(&self) -> &Vec<u8> ⓘ
pub fn transcript_hash(&self) -> &Vec<u8> ⓘ
Get the transcript hash for the current epoch that the group is in.
Sourcepub fn tree_hash(&self) -> &[u8] ⓘ
pub fn tree_hash(&self) -> &[u8] ⓘ
Get the tree hash for the current epoch that the group is in.
Sourcepub fn get_member_with_identity(
&self,
identity_id: &SigningIdentity,
) -> Result<Member, MlsError>
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,
impl<C> ExternalGroup<C>where
C: ExternalClientConfig + Clone,
Sourcepub fn snapshot(&self) -> ExternalSnapshot
pub fn snapshot(&self) -> ExternalSnapshot
Create a snapshot of this group’s current internal state.
Sourcepub fn snapshot_without_ratchet_tree(&mut self) -> ExternalSnapshot
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>
impl<C> Clone for ExternalGroup<C>
Source§fn clone(&self) -> ExternalGroup<C>
fn clone(&self) -> ExternalGroup<C>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreAuto 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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