Struct core_crypto::mls::conversation::MlsConversation

source ·
pub struct MlsConversation { /* private fields */ }
Expand description

This is a wrapper on top of the OpenMls’s MlsGroup, that provides Core Crypto specific functionality

This type will store the state of a group. With the MlsGroup it holds, it provides all operations that can be done in a group, such as creating proposals and commits. More information here

Implementations§

source§

impl MlsConversation

source

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 client
  • epoch - current group epoch
  • nb_members - number of clients in the group
source§

impl MlsConversation

Abstraction over a MLS group capable of decrypting a MLS message

source

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

Abstraction over a MLS group capable of encrypting a MLS message

source

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

source

pub fn export_secret_key( &self, backend: &impl OpenMlsCryptoProvider, key_length: usize, ) -> CryptoResult<Vec<u8>>

source

pub fn get_client_ids(&self) -> Vec<ClientId>

source§

impl MlsConversation

Abstraction over a MLS group capable of merging a commit

source§

impl MlsConversation

Creating proposals

source§

impl MlsConversation

source

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 identifier
  • author_client - the client responsible for creating the group
  • creator_credential_type - kind of credential the creator wants to join the group with
  • config - group configuration
  • backend - MLS Provider that will be used to persist the group
§Errors

Errors can happen from OpenMls or from the KeyStore

source

pub fn id(&self) -> &ConversationId

Group/conversation id

source

pub fn members(&self) -> HashMap<Vec<u8>, Credential>

Returns all members credentials from the group/conversation

source

pub fn members_with_key(&self) -> HashMap<Vec<u8>, CredentialWithKey>

Returns all members credentials with their signature public key from the group/conversation

source

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

source

pub fn members_in_next_epoch(&self) -> Vec<ClientId>

Get actual group members and subtract pending remove proposals

Trait Implementations§

source§

impl Debug for MlsConversation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
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> Same for T

source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V