Struct openmls::prelude::PublicGroup
source · pub struct PublicGroup { /* private fields */ }
Expand description
This struct holds all public values of an MLS group.
Implementations§
source§impl PublicGroup
impl PublicGroup
sourcepub fn process_message(
&self,
backend: &impl OpenMlsCryptoProvider,
message: impl Into<ProtocolMessage>
) -> Result<ProcessedMessage, ProcessMessageError>
pub fn process_message( &self, backend: &impl OpenMlsCryptoProvider, message: impl Into<ProtocolMessage> ) -> Result<ProcessedMessage, ProcessMessageError>
This function is used to parse messages from the DS. It checks for syntactic errors and does semantic validation as well. It returns a ProcessedMessage enum. Checks the following semantic validation:
- ValSem002
- ValSem003
- ValSem004
- ValSem005
- ValSem006
- ValSem007
- ValSem008
- ValSem009
- ValSem010
- ValSem101
- ValSem102
- ValSem104
- ValSem106
- ValSem107
- ValSem108
- ValSem110
- ValSem111
- ValSem112
- ValSem200
- ValSem201
- ValSem202: Path must be the right length
- ValSem203: Path secrets must decrypt correctly
- ValSem204: Public keys from Path must be verified and match the private keys from the direct path
- ValSem205
- ValSem240
- ValSem241
- ValSem242
- ValSem243
- ValSem244
- ValSem245
- ValSem246 (as part of ValSem010)
source§impl PublicGroup
impl PublicGroup
sourcepub fn merge_commit(&mut self, staged_commit: StagedCommit)
pub fn merge_commit(&mut self, staged_commit: StagedCommit)
Merges a StagedCommit into the public group state.
This function should not fail and only returns a Result
, because it
might throw a LibraryError
.
source§impl PublicGroup
impl PublicGroup
sourcepub fn from_external(
backend: &impl OpenMlsCryptoProvider,
ratchet_tree: RatchetTreeIn,
verifiable_group_info: VerifiableGroupInfo,
proposal_store: ProposalStore
) -> Result<(Self, GroupInfo), CreationFromExternalError>
pub fn from_external( backend: &impl OpenMlsCryptoProvider, ratchet_tree: RatchetTreeIn, verifiable_group_info: VerifiableGroupInfo, proposal_store: ProposalStore ) -> Result<(Self, GroupInfo), CreationFromExternalError>
Create a PublicGroup
instance to start tracking an existing MLS group.
This function performs basic validation checks and returns an error if
one of the checks fails. See CreationFromExternalError
for more
details.
sourcepub fn ext_commit_sender_index(
&self,
commit: &StagedCommit
) -> Result<LeafNodeIndex, LibraryError>
pub fn ext_commit_sender_index( &self, commit: &StagedCommit ) -> Result<LeafNodeIndex, LibraryError>
Returns the index of the sender of a staged, external commit.
sourcepub fn members(&self) -> impl Iterator<Item = Member> + '_
pub fn members(&self) -> impl Iterator<Item = Member> + '_
Get an iterator over all Member
s of this PublicGroup
.
sourcepub fn export_ratchet_tree(&self) -> RatchetTree
pub fn export_ratchet_tree(&self) -> RatchetTree
Export the nodes of the public tree.
sourcepub fn add_proposal(&mut self, proposal: QueuedProposal)
pub fn add_proposal(&mut self, proposal: QueuedProposal)
Add the QueuedProposal
to the PublicGroup
s internal ProposalStore
.
source§impl PublicGroup
impl PublicGroup
sourcepub fn ciphersuite(&self) -> Ciphersuite
pub fn ciphersuite(&self) -> Ciphersuite
Get the ciphersuite.
sourcepub fn version(&self) -> ProtocolVersion
pub fn version(&self) -> ProtocolVersion
Get the version.
sourcepub fn group_context(&self) -> &GroupContext
pub fn group_context(&self) -> &GroupContext
Get the group context.
sourcepub fn required_capabilities(&self) -> Option<&RequiredCapabilitiesExtension>
pub fn required_capabilities(&self) -> Option<&RequiredCapabilitiesExtension>
Get the required capabilities.
sourcepub fn confirmation_tag(&self) -> &ConfirmationTag
pub fn confirmation_tag(&self) -> &ConfirmationTag
Get confirmation tag.
sourcepub fn leaf(&self, leaf_index: LeafNodeIndex) -> Option<&LeafNode>
pub fn leaf(&self, leaf_index: LeafNodeIndex) -> Option<&LeafNode>
Return a reference to the leaf at the given LeafNodeIndex
or None
if the
leaf is blank.