Trait core_crypto_keystore::CryptoKeystoreMls

source ·
pub trait CryptoKeystoreMls: Sized {
    // Required methods
    fn mls_fetch_keypackages<'life0, 'async_trait, V>(
        &'life0 self,
        count: u32,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<V>>> + Send + 'async_trait>>
       where V: 'async_trait + MlsEntity,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn mls_group_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        group_id: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn mls_group_persist<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        group_id: &'life1 [u8],
        state: &'life2 [u8],
        parent_group_id: Option<&'life3 [u8]>,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn mls_groups_restore<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<HashMap<Vec<u8>, (Option<Vec<u8>>, Vec<u8>)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn mls_group_delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        group_id: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn mls_pending_groups_save<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        group_id: &'life1 [u8],
        mls_group: &'life2 [u8],
        custom_configuration: &'life3 [u8],
        parent_group_id: Option<&'life4 [u8]>,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn mls_pending_groups_load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        group_id: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<(Vec<u8>, Vec<u8>)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn mls_pending_groups_delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        group_id: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_e2ei_enrollment<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 [u8],
        content: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn pop_e2ei_enrollment<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

An interface for the specialized queries in the KeyStore

Required Methods§

source

fn mls_fetch_keypackages<'life0, 'async_trait, V>( &'life0 self, count: u32, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<V>>> + Send + 'async_trait>>
where V: 'async_trait + MlsEntity, Self: 'async_trait, 'life0: 'async_trait,

Fetches Keypackages

§Arguments
  • count - amount of entries to be returned
§Errors

Any common error that can happen during a database connection. IoError being a common error for example.

source

fn mls_group_exists<'life0, 'life1, 'async_trait>( &'life0 self, group_id: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Checks if the given MLS group id exists in the keystore Note: in case of any error, this will return false

§Arguments
  • group_id - group/conversation id
source

fn mls_group_persist<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, group_id: &'life1 [u8], state: &'life2 [u8], parent_group_id: Option<&'life3 [u8]>, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Persists a MlsGroup

§Arguments
  • group_id - group/conversation id
  • state - the group state
§Errors

Any common error that can happen during a database connection. IoError being a common error for example.

source

fn mls_groups_restore<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<HashMap<Vec<u8>, (Option<Vec<u8>>, Vec<u8>)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Loads MlsGroups from the database. It will be returned as a HashMap where the key is the group/conversation id and the value the group state

§Errors

Any common error that can happen during a database connection. IoError being a common error for example.

source

fn mls_group_delete<'life0, 'life1, 'async_trait>( &'life0 self, group_id: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes MlsGroups from the database.

§Errors

Any common error that can happen during a database connection. IoError being a common error for example.

source

fn mls_pending_groups_save<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, group_id: &'life1 [u8], mls_group: &'life2 [u8], custom_configuration: &'life3 [u8], parent_group_id: Option<&'life4 [u8]>, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Saves a MlsGroup in a temporary table (typically used in scenarios where the group cannot be committed until the backend acknowledges it, like external commits)

§Arguments
  • group_id - group/conversation id
  • mls_group - the group/conversation state
  • custom_configuration - local group configuration
§Errors

Any common error that can happen during a database connection. IoError being a common error for example.

source

fn mls_pending_groups_load<'life0, 'life1, 'async_trait>( &'life0 self, group_id: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<(Vec<u8>, Vec<u8>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads a temporary MlsGroup and its configuration from the database

§Arguments
  • id - group/conversation id
§Errors

Any common error that can happen during a database connection. IoError being a common error for example.

source

fn mls_pending_groups_delete<'life0, 'life1, 'async_trait>( &'life0 self, group_id: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes a temporary MlsGroup from the database

§Arguments
  • id - group/conversation id
§Errors

Any common error that can happen during a database connection. IoError being a common error for example.

source

fn save_e2ei_enrollment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 [u8], content: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Persists an enrollment instance

§Arguments
  • id - hash of the enrollment and unique identifier
  • content - serialized enrollment
source

fn pop_e2ei_enrollment<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetches and delete the enrollment instance

§Arguments
  • id - hash of the enrollment and unique identifier

Object Safety§

This trait is not object safe.

Implementors§