Struct core_crypto::mls::conversation::MlsConversation
source · pub struct MlsConversation { /* private fields */ }
Expand description
Implementations§
source§impl MlsConversation
impl MlsConversation
sourcepub fn compute_next_commit_delay(&self) -> Option<u64>
pub fn compute_next_commit_delay(&self) -> Option<u64>
Helps consumer by providing a deterministic delay in seconds for him to commit its pending proposal. It depends on the index of the client in the ratchet tree
self_index
- ratchet tree index of self clientepoch
- current group epochnb_members
- number of clients in the group
source§impl MlsConversation
impl MlsConversation
Abstraction over a MLS group capable of decrypting a MLS message
sourcepub async fn decrypt_message(
&mut self,
message: MlsMessageIn,
parent_conv: Option<&Arc<RwLock<MlsConversation>>>,
client: &Client,
backend: &MlsCryptoProvider,
callbacks: Option<&dyn CoreCryptoCallbacks>,
restore_pending: bool,
) -> CryptoResult<MlsConversationDecryptMessage>
pub async fn decrypt_message( &mut self, message: MlsMessageIn, parent_conv: Option<&Arc<RwLock<MlsConversation>>>, client: &Client, backend: &MlsCryptoProvider, callbacks: Option<&dyn CoreCryptoCallbacks>, restore_pending: bool, ) -> CryptoResult<MlsConversationDecryptMessage>
source§impl MlsConversation
impl MlsConversation
Abstraction over a MLS group capable of encrypting a MLS message
sourcepub async fn encrypt_message(
&mut self,
client: &Client,
message: impl AsRef<[u8]>,
backend: &MlsCryptoProvider,
) -> CryptoResult<Vec<u8>>
pub async fn encrypt_message( &mut self, client: &Client, message: impl AsRef<[u8]>, backend: &MlsCryptoProvider, ) -> CryptoResult<Vec<u8>>
see CentralContext::encrypt_message It is durable because encrypting increments the message generation
source§impl MlsConversation
impl MlsConversation
sourcepub fn export_secret_key(
&self,
backend: &impl OpenMlsCryptoProvider,
key_length: usize,
) -> CryptoResult<Vec<u8>>
pub fn export_secret_key( &self, backend: &impl OpenMlsCryptoProvider, key_length: usize, ) -> CryptoResult<Vec<u8>>
sourcepub fn get_client_ids(&self) -> Vec<ClientId>
pub fn get_client_ids(&self) -> Vec<ClientId>
source§impl MlsConversation
impl MlsConversation
Abstraction over a MLS group capable of merging a commit
sourcepub async fn commit_accepted(
&mut self,
backend: &MlsCryptoProvider,
) -> CryptoResult<()>
pub async fn commit_accepted( &mut self, backend: &MlsCryptoProvider, ) -> CryptoResult<()>
sourcepub async fn clear_pending_proposal(
&mut self,
proposal_ref: MlsProposalRef,
backend: &MlsCryptoProvider,
) -> CryptoResult<()>
pub async fn clear_pending_proposal( &mut self, proposal_ref: MlsProposalRef, backend: &MlsCryptoProvider, ) -> CryptoResult<()>
sourcepub async fn clear_pending_commit(
&mut self,
backend: &MlsCryptoProvider,
) -> CryptoResult<()>
pub async fn clear_pending_commit( &mut self, backend: &MlsCryptoProvider, ) -> CryptoResult<()>
source§impl MlsConversation
impl MlsConversation
Creating proposals
sourcepub async fn propose_add_member(
&mut self,
client: &Client,
backend: &MlsCryptoProvider,
key_package: KeyPackageIn,
) -> CryptoResult<MlsProposalBundle>
pub async fn propose_add_member( &mut self, client: &Client, backend: &MlsCryptoProvider, key_package: KeyPackageIn, ) -> CryptoResult<MlsProposalBundle>
sourcepub async fn propose_remove_member(
&mut self,
client: &Client,
backend: &MlsCryptoProvider,
member: LeafNodeIndex,
) -> CryptoResult<MlsProposalBundle>
pub async fn propose_remove_member( &mut self, client: &Client, backend: &MlsCryptoProvider, member: LeafNodeIndex, ) -> CryptoResult<MlsProposalBundle>
sourcepub async fn propose_self_update(
&mut self,
client: &Client,
backend: &MlsCryptoProvider,
) -> CryptoResult<MlsProposalBundle>
pub async fn propose_self_update( &mut self, client: &Client, backend: &MlsCryptoProvider, ) -> CryptoResult<MlsProposalBundle>
sourcepub async fn propose_explicit_self_update(
&mut self,
client: &Client,
backend: &MlsCryptoProvider,
leaf_node: Option<LeafNode>,
) -> CryptoResult<MlsProposalBundle>
pub async fn propose_explicit_self_update( &mut self, client: &Client, backend: &MlsCryptoProvider, leaf_node: Option<LeafNode>, ) -> CryptoResult<MlsProposalBundle>
source§impl MlsConversation
impl MlsConversation
sourcepub async fn create(
id: ConversationId,
author_client: &Client,
creator_credential_type: MlsCredentialType,
configuration: MlsConversationConfiguration,
backend: &MlsCryptoProvider,
) -> CryptoResult<Self>
pub async fn create( id: ConversationId, author_client: &Client, creator_credential_type: MlsCredentialType, configuration: MlsConversationConfiguration, backend: &MlsCryptoProvider, ) -> CryptoResult<Self>
Creates a new group/conversation
§Arguments
id
- group/conversation identifierauthor_client
- the client responsible for creating the groupcreator_credential_type
- kind of credential the creator wants to join the group withconfig
- group configurationbackend
- MLS Provider that will be used to persist the group
§Errors
Errors can happen from OpenMls or from the KeyStore
sourcepub fn id(&self) -> &ConversationId
pub fn id(&self) -> &ConversationId
Group/conversation id
sourcepub fn members(&self) -> HashMap<Vec<u8>, Credential>
pub fn members(&self) -> HashMap<Vec<u8>, Credential>
Returns all members credentials from the group/conversation
sourcepub fn members_with_key(&self) -> HashMap<Vec<u8>, CredentialWithKey>
pub fn members_with_key(&self) -> HashMap<Vec<u8>, CredentialWithKey>
Returns all members credentials with their signature public key from the group/conversation
sourcepub async fn mark_as_child_of(
&mut self,
parent_id: &ConversationId,
keystore: &Connection,
) -> CryptoResult<()>
pub async fn mark_as_child_of( &mut self, parent_id: &ConversationId, keystore: &Connection, ) -> CryptoResult<()>
Marks this conversation as child of another. Prequisite: Being a member of this group and for it to be stored in the keystore
source§impl MlsConversation
impl MlsConversation
sourcepub fn members_in_next_epoch(&self) -> Vec<ClientId>
pub fn members_in_next_epoch(&self) -> Vec<ClientId>
Get actual group members and subtract pending remove proposals
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MlsConversation
impl RefUnwindSafe for MlsConversation
impl Send for MlsConversation
impl Sync for MlsConversation
impl Unpin for MlsConversation
impl UnwindSafe for MlsConversation
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Read moresource§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