Struct mls_rs::external_client::ExternalGroup
source · 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 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 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.