pub fn create_message(
        &mut self,
        backend: &impl OpenMlsCryptoProvider,
        message: &[u8],
    ) -> Result<MlsMessageOut, ManagedGroupError> {
        if !self.active {
            return Err(ManagedGroupError::UseAfterEviction(UseAfterEviction::Error));
        }
        if !self.pending_proposals.is_empty() {
            return Err(ManagedGroupError::PendingProposalsExist(
                PendingProposalsError::Exists,
            ));
        }

        let credential = self.credential()?;
        let credential_bundle: CredentialBundle = backend
            .key_store()
            .read(credential.signature_key())
            .ok_or(ManagedGroupError::NoMatchingCredentialBundle)?;

        let ciphertext = self.group.create_application_message(
            &self.aad,
            message,
            &credential_bundle,
            self.configuration().padding_size(),
            backend,
        )?;

        // Since the state of the group was changed, call the auto-save function
        self.auto_save();

        Ok(MlsMessageOut::Ciphertext(ciphertext))
    }
/// Creates an application message.
/// Returns `ManagedGroupError::UseAfterEviction(UseAfterEviction::Error)`
/// if the member is no longer part of the group.
/// Returns `ManagedGroupError::PendingProposalsExist` if pending proposals
/// exist. In that case `.process_pending_proposals()` must be called first
/// and incoming messages from the DS must be processed afterwards.
Creates an application message.
Returns `ManagedGroupError::UseAfterEviction(UseAfterEviction::Error)`
if the member is no longer part of the group.
Creates an application message . Returns ` ManagedGroupError :: UseAfterEviction ( UseAfterEviction :: Error ) ` if the member is no longer part of the group .
pub fn create_message(
        &mut self,
        backend: &impl OpenMlsCryptoProvider,
        message: &[u8],
    ) -> Result<MlsMessageOut, ManagedGroupError> {
        if !self.active {
            return Err(ManagedGroupError::UseAfterEviction(UseAfterEviction::Error));
        }
        if !self.pending_proposals.is_empty() {
            return Err(ManagedGroupError::PendingProposalsExist(
                PendingProposalsError::Exists,
            ));
        }
        let credential = self.credential()?;
        let credential_bundle: CredentialBundle = backend
            .key_store()
            .read(credential.signature_key())
            .ok_or(ManagedGroupError::NoMatchingCredentialBundle)?;
        let ciphertext = self.group.create_application_message(
            &self.aad,
            message,
            &credential_bundle,
            self.configuration().padding_size(),
            backend,
        )?;
        // Since the state of the group was changed, call the auto-save function
        self.auto_save();
        Ok(MlsMessageOut::Ciphertext(ciphertext))
    }
pub fn create_message ( & mut self , backend : & impl OpenMlsCryptoProvider , message : & [ u8 ] , ) -> Result < MlsMessageOut , ManagedGroupError > { if ! self . active { return Err ( ManagedGroupError :: UseAfterEviction ( UseAfterEviction :: Error ) ) ; } if ! self . pending_proposals . is_empty ( ) { return Err ( ManagedGroupError :: PendingProposalsExist ( PendingProposalsError :: Exists , ) ) ; } let credential = self . credential ( ) ? ; let credential_bundle : CredentialBundle = backend . key_store ( ) . read ( credential . signature_key ( ) ) . ok_or ( ManagedGroupError :: NoMatchingCredentialBundle ) ? ; let ciphertext = self . group . create_application_message ( & self . aad , message , & credential_bundle , self . configuration ( ) . padding_size ( ) , backend , ) ? ; // Since the state of the group was changed, call the auto-save function self . auto_save ( ) ; Ok ( MlsMessageOut :: Ciphertext ( ciphertext ) ) }
Creates an application message.
Creates an application message .
&mut self
backend
&impl OpenMlsCryptoProvider
message
&[u8]
&mut self
backend
&impl OpenMlsCryptoProvider
message
&[u8]