// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // Copyright by contributors to this project. // SPDX-License-Identifier: (Apache-2.0 OR MIT)
#[derive(Clone, Debug, PartialEq, MlsSize, MlsEncode, MlsDecode)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// A proposal that adds a member to a [`Group`](crate::group::Group). pubstruct AddProposal { pub(crate) key_package: KeyPackage,
}
impl AddProposal { /// The [`SigningIdentity`] of the [`Member`](mls_rs_core::group::Member) /// that will be added by this proposal. pubfn signing_identity(&self) -> &SigningIdentity { self.key_package.signing_identity()
}
/// Client [`Capabilities`] of the [`Member`](mls_rs_core::group::Member) /// that will be added by this proposal. pubfn capabilities(&self) -> Capabilities { self.key_package.leaf_node.ungreased_capabilities()
}
/// Key package extensions that are assoiciated with the /// [`Member`](mls_rs_core::group::Member) that will be added by this proposal. pubfn key_package_extensions(&self) -> ExtensionList { self.key_package.ungreased_extensions()
}
/// Leaf node extensions that will be entered into the group state for the /// [`Member`](mls_rs_core::group::Member) that will be added. pubfn leaf_node_extensions(&self) -> ExtensionList { self.key_package.leaf_node.ungreased_extensions()
}
}
#[cfg(feature = "by_ref_proposal")] #[derive(Clone, Debug, PartialEq, MlsSize, MlsEncode, MlsDecode)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// A proposal that will update an existing [`Member`](mls_rs_core::group::Member) of a /// [`Group`](crate::group::Group). pubstruct UpdateProposal { pub(crate) leaf_node: LeafNode,
}
#[cfg(feature = "by_ref_proposal")] impl UpdateProposal { /// The new [`SigningIdentity`] of the [`Member`](mls_rs_core::group::Member) /// that is being updated by this proposal. pubfn signing_identity(&self) -> &SigningIdentity {
&self.leaf_node.signing_identity
}
/// New Client [`Capabilities`] of the [`Member`](mls_rs_core::group::Member) /// that will be updated by this proposal. pubfn capabilities(&self) -> Capabilities { self.leaf_node.ungreased_capabilities()
}
/// New Leaf node extensions that will be entered into the group state for the /// [`Member`](mls_rs_core::group::Member) that is being updated by this proposal. pubfn leaf_node_extensions(&self) -> ExtensionList { self.leaf_node.ungreased_extensions()
}
}
#[derive(Clone, Debug, PartialEq, Eq, MlsSize, MlsEncode, MlsDecode)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// A proposal to remove an existing [`Member`](mls_rs_core::group::Member) of a /// [`Group`](crate::group::Group). pubstruct RemoveProposal { pub(crate) to_remove: LeafIndex,
}
impl RemoveProposal { /// The index of the [`Member`](mls_rs_core::group::Member) that will be removed by /// this proposal. pubfn to_remove(&self) -> u32 {
*self.to_remove
}
}
#[cfg(feature = "psk")] #[derive(Clone, Debug, PartialEq, Eq, MlsSize, MlsEncode, MlsDecode)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// A proposal to add a pre-shared key to a group. pubstruct PreSharedKeyProposal { pub(crate) psk: PreSharedKeyID,
}
#[cfg(feature = "psk")] impl PreSharedKeyProposal { /// The external pre-shared key id of this proposal. /// /// MLS requires the pre-shared key type for PreSharedKeyProposal to be of /// type `External`. /// /// Returns `None` in the condition that the underlying psk is not external. pubfn external_psk_id(&self) -> Option<&ExternalPskId> { matchself.psk.key_id {
JustPreSharedKeyID::External(ref ext) => Some(ext),
JustPreSharedKeyID::Resumption(_) => None,
}
}
}
#[derive(Clone, PartialEq, MlsSize, MlsEncode, MlsDecode)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// A proposal to reinitialize a group using new parameters. pubstruct ReInitProposal { #[mls_codec(with = "mls_rs_codec::byte_vec")] #[cfg_attr(feature = "serde", serde(with = "mls_rs_core::vec_serde"))] pub(crate) group_id: Vec<u8>, pub(crate) version: ProtocolVersion, pub(crate) cipher_suite: CipherSuite, pub(crate) extensions: ExtensionList,
}
impl ReInitProposal { /// The unique id of the new group post reinitialization. pubfn group_id(&self) -> &[u8] {
&self.group_id
}
/// The new protocol version to use post reinitialization. pubfn new_version(&self) -> ProtocolVersion { self.version
}
/// The new ciphersuite to use post reinitialization. pubfn new_cipher_suite(&self) -> CipherSuite { self.cipher_suite
}
/// Group context extensions to set in the new group post reinitialization. pubfn new_group_context_extensions(&self) -> &ExtensionList {
&self.extensions
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.