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§
sourcefn 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_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,
sourcefn 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_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
sourcefn 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_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,
sourcefn 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_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.
sourcefn 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_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.
sourcefn 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_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 idmls_group
- the group/conversation statecustom_configuration
- local group configuration
§Errors
Any common error that can happen during a database connection. IoError being a common error for example.
sourcefn 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_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,
sourcefn 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 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,
sourcefn 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 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 identifiercontent
- serialized enrollment
sourcefn 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,
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