#[non_exhaustive]pub struct MlsClientConfiguration {
pub store_path: String,
pub database_key: DatabaseKey,
pub client_id: Option<ClientId>,
pub external_entropy: Option<EntropySeed>,
pub ciphersuites: Vec<MlsCiphersuite>,
pub nb_init_key_packages: Option<usize>,
}
Expand description
Configuration parameters for [Client].
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.store_path: String
Location where the SQLite/IndexedDB database will be stored
database_key: DatabaseKey
Database key to be used to instantiate the MlsCryptoProvider
client_id: Option<ClientId>
Identifier for the client to be used by [MlsCentral]
external_entropy: Option<EntropySeed>
Entropy pool seed for the internal PRNG
ciphersuites: Vec<MlsCiphersuite>
All supported ciphersuites
nb_init_key_packages: Option<usize>
Number of openmls::prelude::KeyPackage to create when creating a MLS client. Default to INITIAL_KEYING_MATERIAL_COUNT
Implementations§
Source§impl MlsClientConfiguration
impl MlsClientConfiguration
Sourcepub fn try_new(
store_path: String,
database_key: DatabaseKey,
client_id: Option<ClientId>,
ciphersuites: Vec<MlsCiphersuite>,
entropy: Option<Vec<u8>>,
nb_init_key_packages: Option<usize>,
) -> Result<Self>
pub fn try_new( store_path: String, database_key: DatabaseKey, client_id: Option<ClientId>, ciphersuites: Vec<MlsCiphersuite>, entropy: Option<Vec<u8>>, nb_init_key_packages: Option<usize>, ) -> Result<Self>
Creates a new instance of the configuration.
§Arguments
store_path
- location where the SQLite/IndexedDB database will be storeddatabase_key
- key to be used to instantiate the MlsCryptoProviderclient_id
- identifier for the client to be used by [MlsCentral]ciphersuites
- Ciphersuites supported by this deviceentropy
- External source of entropy for platforms where default source insufficient
§Errors
Any empty string parameter will result in a Error::MalformedIdentifier error.
§Examples
use core_crypto::prelude::{MlsClientConfiguration, MlsCiphersuite};
use core_crypto::DatabaseKey;
let result = MlsClientConfiguration::try_new(
"/tmp/crypto".to_string(),
DatabaseKey::generate(),
Some(b"MY_CLIENT_ID".to_vec().into()),
vec![MlsCiphersuite::default()],
None,
Some(100),
);
assert!(result.is_ok());
Sourcepub fn set_entropy(&mut self, entropy: EntropySeed)
pub fn set_entropy(&mut self, entropy: EntropySeed)
Sets the entropy seed
Trait Implementations§
Source§impl Clone for MlsClientConfiguration
impl Clone for MlsClientConfiguration
Source§fn clone(&self) -> MlsClientConfiguration
fn clone(&self) -> MlsClientConfiguration
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for MlsClientConfiguration
impl RefUnwindSafe for MlsClientConfiguration
impl Send for MlsClientConfiguration
impl Sync for MlsClientConfiguration
impl Unpin for MlsClientConfiguration
impl UnwindSafe for MlsClientConfiguration
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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>
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 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>
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