pub struct MlsCentral { /* private fields */ }
Expand description
The entry point for the MLS CoreCrypto library. This struct provides all functionality to create and manage groups, make proposals and commits.
Implementations§
Source§impl MlsCentral
impl MlsCentral
Sourcepub async fn get_raw_conversation(
&self,
id: &ConversationId,
) -> Result<ImmutableConversation>
pub async fn get_raw_conversation( &self, id: &ConversationId, ) -> Result<ImmutableConversation>
Get an immutable view of an MlsConversation
.
Because it operates on the raw conversation type, this may be faster than CentralContext::conversation
for transient and immutable purposes. For long-lived or mutable purposes, prefer the other method.
Source§impl MlsCentral
impl MlsCentral
Sourcepub async fn try_new(configuration: MlsCentralConfiguration) -> Result<Self>
pub async fn try_new(configuration: MlsCentralConfiguration) -> Result<Self>
Tries to initialize the MLS Central object. Takes a store path (i.e. Disk location of the embedded database, should be consistent between messaging sessions) And a root identity key (i.e. enclaved encryption key for this device)
§Arguments
configuration
- the configuration for theMlsCentral
§Errors
Failures in the initialization of the KeyStore can cause errors, such as IO, the same kind
of errors can happen when the groups are being restored from the KeyStore or even during
the client initialization (to fetch the identity signature). Other than that, MlsError
can be caused by group deserialization or during the initialization of the credentials:
- for x509 Credentials if the cetificate chain length is lower than 2
- for Basic Credentials if the signature key cannot be generated either by not supported scheme or the key generation fails
Sourcepub async fn try_new_in_memory(
configuration: MlsCentralConfiguration,
) -> Result<Self>
pub async fn try_new_in_memory( configuration: MlsCentralConfiguration, ) -> Result<Self>
Same as the MlsCentral::try_new but instead, it uses an in memory KeyStore. Although required, the store_path
parameter from the MlsCentralConfiguration
won’t be used here.
Sourcepub async fn provide_transport(&self, transport: Arc<dyn MlsTransport>)
pub async fn provide_transport(&self, transport: Arc<dyn MlsTransport>)
Provide the implementation of functions to communicate with the delivery service (see MlsTransport).
Sourcepub async fn client_public_key(
&self,
ciphersuite: MlsCiphersuite,
credential_type: MlsCredentialType,
) -> Result<Vec<u8>>
pub async fn client_public_key( &self, ciphersuite: MlsCiphersuite, credential_type: MlsCredentialType, ) -> Result<Vec<u8>>
Returns the client’s most recent public signature key as a buffer. Used to upload a public key to the server in order to verify client’s messages signature.
§Arguments
ciphersuite
- a callback to be called to perform authorizationcredential_type
- of the credential to look for
Sourcepub async fn conversation_exists(&self, id: &ConversationId) -> Result<bool>
pub async fn conversation_exists(&self, id: &ConversationId) -> Result<bool>
Checks if a given conversation id exists locally
Sourcepub fn random_bytes(&self, len: usize) -> Result<Vec<u8>>
pub fn random_bytes(&self, len: usize) -> Result<Vec<u8>>
Generates a random byte array of the specified size
Source§impl MlsCentral
impl MlsCentral
Sourcepub async fn e2ei_verify_group_state(
&self,
group_info: VerifiableGroupInfo,
) -> Result<E2eiConversationState>
pub async fn e2ei_verify_group_state( &self, group_info: VerifiableGroupInfo, ) -> Result<E2eiConversationState>
Verifies a Group state before joining it
Sourcepub async fn get_credential_in_use(
&self,
group_info: VerifiableGroupInfo,
credential_type: MlsCredentialType,
) -> Result<E2eiConversationState>
pub async fn get_credential_in_use( &self, group_info: VerifiableGroupInfo, credential_type: MlsCredentialType, ) -> Result<E2eiConversationState>
Gets the e2ei conversation state from a GroupInfo
. Useful to check if the group has e2ei
turned on or not before joining it.
Source§impl MlsCentral
impl MlsCentral
Sourcepub async fn e2ei_is_enabled(
&self,
signature_scheme: SignatureScheme,
) -> Result<bool>
pub async fn e2ei_is_enabled( &self, signature_scheme: SignatureScheme, ) -> Result<bool>
Returns true when end-to-end-identity is enabled for the given SignatureScheme
Source§impl MlsCentral
impl MlsCentral
Sourcepub async fn e2ei_is_pki_env_setup(&self) -> bool
pub async fn e2ei_is_pki_env_setup(&self) -> bool
Returns whether the E2EI PKI environment is setup (i.e. Root CA, Intermediates, CRLs)
Sourcepub async fn e2ei_dump_pki_env(&self) -> Result<Option<E2eiDumpedPkiEnv>>
pub async fn e2ei_dump_pki_env(&self) -> Result<Option<E2eiDumpedPkiEnv>>
Dumps the PKI environment as PEM
Trait Implementations§
Source§impl Clone for MlsCentral
impl Clone for MlsCentral
Source§fn clone(&self) -> MlsCentral
fn clone(&self) -> MlsCentral
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MlsCentral
impl Debug for MlsCentral
Source§impl From<MlsCentral> for CoreCrypto
impl From<MlsCentral> for CoreCrypto
Source§fn from(mls: MlsCentral) -> Self
fn from(mls: MlsCentral) -> Self
Auto Trait Implementations§
impl Freeze for MlsCentral
impl !RefUnwindSafe for MlsCentral
impl Send for MlsCentral
impl Sync for MlsCentral
impl Unpin for MlsCentral
impl !UnwindSafe for MlsCentral
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
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>
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>
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