Struct mls_crypto_provider::CryptoKeystore

pub struct CryptoKeystore { /* private fields */ }

Implementations§

§

impl Connection

pub async fn open_with_key( name: impl AsRef<str>, key: impl AsRef<str>, ) -> Result<Connection, CryptoKeystoreError>

pub async fn open_in_memory_with_key( name: impl AsRef<str>, key: impl AsRef<str>, ) -> Result<Connection, CryptoKeystoreError>

pub async fn borrow_conn( &self, ) -> Result<MutexGuard<'_, SqlCipherConnection>, CryptoKeystoreError>

pub async fn save<E>(&self, entity: E) -> Result<E, CryptoKeystoreError>
where E: Entity<ConnectionType = SqlCipherConnection>,

pub async fn insert<E>( &self, entity: E, ) -> Result<<E as EntityBase>::AutoGeneratedFields, CryptoKeystoreError>
where E: Entity<ConnectionType = SqlCipherConnection> + Sync,

pub async fn find<E>( &self, id: impl AsRef<[u8]>, ) -> Result<Option<E>, CryptoKeystoreError>
where E: Entity<ConnectionType = SqlCipherConnection>,

pub async fn find_all<E>( &self, params: EntityFindParams, ) -> Result<Vec<E>, CryptoKeystoreError>
where E: Entity<ConnectionType = SqlCipherConnection>,

pub async fn find_many<E, S>( &self, ids: &[S], ) -> Result<Vec<E>, CryptoKeystoreError>
where E: Entity<ConnectionType = SqlCipherConnection>, S: AsRef<[u8]>,

pub async fn remove<E, S>(&self, id: S) -> Result<(), CryptoKeystoreError>
where E: Entity<ConnectionType = SqlCipherConnection>, S: AsRef<[u8]>,

pub async fn count<E>(&self) -> Result<usize, CryptoKeystoreError>
where E: Entity<ConnectionType = SqlCipherConnection>,

pub async fn wipe(self) -> Result<(), CryptoKeystoreError>

pub async fn close(self) -> Result<(), CryptoKeystoreError>

Trait Implementations§

§

impl CryptoKeystoreMls for Connection

§

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

Fetches Keypackages Read more
§

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 = Result<(), CryptoKeystoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Connection: 'async_trait,

Persists a MlsGroup Read more
§

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

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

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

Deletes MlsGroups from the database. Read more
§

fn mls_groups_restore<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HashMap<Vec<u8>, (Option<Vec<u8>>, Vec<u8>)>, CryptoKeystoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Connection: '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 Read more
§

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 = Result<(), CryptoKeystoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, Connection: '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) Read more
§

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

Loads a temporary MlsGroup and its configuration from the database Read more
§

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

Deletes a temporary MlsGroup from the database Read more
§

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

Persists an enrollment instance Read more
§

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

Fetches and delete the enrollment instance Read more
§

impl CryptoKeystoreProteus for Connection

§

fn proteus_store_prekey<'life0, 'life1, 'async_trait>( &'life0 self, id: u16, prekey: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), CryptoKeystoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Connection: 'async_trait,

§

impl Debug for Connection

§

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

Formats the value using the given formatter. Read more
§

impl OpenMlsKeyStore for Connection

§

type Error = CryptoKeystoreError

The error type returned by the [OpenMlsKeyStore].
§

fn store<'life0, 'life1, 'life2, 'async_trait, V>( &'life0 self, k: &'life1 [u8], v: &'life2 V, ) -> Pin<Box<dyn Future<Output = Result<(), <Connection as OpenMlsKeyStore>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Connection: Sized + 'async_trait, V: 'async_trait + MlsEntity + Sync,

Store a value v that implements the [MlsEntity] trait for serialization for ID k. Read more
§

fn read<'life0, 'life1, 'async_trait, V>( &'life0 self, k: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Option<V>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Connection: Sized + 'async_trait, V: 'async_trait + MlsEntity,

Read and return a value stored for ID k that implements the [MlsEntity] trait for deserialization. Read more
§

fn delete<'life0, 'life1, 'async_trait, V>( &'life0 self, k: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), <Connection as OpenMlsKeyStore>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, V: 'async_trait + MlsEntity, Connection: 'async_trait,

Delete a value stored for ID k. Read more
§

impl PreKeyStore for Connection

§

type Error = CryptoKeystoreError

§

fn prekey<'life0, 'async_trait>( &'life0 mut self, id: u16, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, <Connection as PreKeyStore>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Connection: 'async_trait,

Lookup prekey by ID.
§

fn remove<'life0, 'async_trait>( &'life0 mut self, id: u16, ) -> Pin<Box<dyn Future<Output = Result<(), <Connection as PreKeyStore>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Connection: 'async_trait,

Remove prekey by ID.
§

impl Send for Connection

§

impl Sync for Connection

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.

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