pub struct KeyPackage { /* private fields */ }Expand description
The key package struct.
Implementations§
Source§impl KeyPackage
impl KeyPackage
Sourcepub fn builder() -> KeyPackageBuilder
pub fn builder() -> KeyPackageBuilder
Create a key package builder.
This is provided for convenience. You can also use KeyPackageBuilder::new.
Sourcepub fn extensions(&self) -> &Extensions<KeyPackage>
pub fn extensions(&self) -> &Extensions<KeyPackage>
Get a reference to the extensions of this key package.
Sourcepub fn check_extension_support(
&self,
required_extensions: &[ExtensionType],
) -> Result<(), KeyPackageExtensionSupportError>
pub fn check_extension_support( &self, required_extensions: &[ExtensionType], ) -> Result<(), KeyPackageExtensionSupportError>
Check whether the this key package supports all the required extensions in the provided list.
Sourcepub fn hash_ref(
&self,
crypto: &impl OpenMlsCrypto,
) -> Result<KeyPackageRef, LibraryError>
pub fn hash_ref( &self, crypto: &impl OpenMlsCrypto, ) -> Result<KeyPackageRef, LibraryError>
Compute the KeyPackageRef of this KeyPackage.
The KeyPackageRef is used to identify a new member that should get
added to a group.
Sourcepub fn ciphersuite(&self) -> Ciphersuite
pub fn ciphersuite(&self) -> Ciphersuite
Get the Ciphersuite.
Sourcepub fn hpke_init_key(&self) -> &InitKey
pub fn hpke_init_key(&self) -> &InitKey
Get the public HPKE init key of this key package.
Sourcepub fn last_resort(&self) -> bool
pub fn last_resort(&self) -> bool
Check if this KeyPackage is a last-resort KeyPackage.
When the extensions-draft feature is enabled, this recognizes the
last_resort_key_package component in the KeyPackage’s
app_data_dictionary. The obsolete last_resort extension is also
recognized so that previously stored KeyPackages remain usable.
Trait Implementations§
Source§impl Clone for KeyPackage
impl Clone for KeyPackage
Source§impl Debug for KeyPackage
impl Debug for KeyPackage
Source§impl<'de> Deserialize<'de> for KeyPackage
impl<'de> Deserialize<'de> for KeyPackage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl ExtensionValidator for KeyPackage
impl ExtensionValidator for KeyPackage
Source§type Error = ExtensionTypeNotValidInKeyPackageError
type Error = ExtensionTypeNotValidInKeyPackageError
Source§fn validate_extension_type(
extension_type: ExtensionType,
) -> Result<(), ExtensionTypeNotValidInKeyPackageError>
fn validate_extension_type( extension_type: ExtensionType, ) -> Result<(), ExtensionTypeNotValidInKeyPackageError>
Source§impl From<FrankenKeyPackage> for KeyPackage
Available on crate features test-utils only.
impl From<FrankenKeyPackage> for KeyPackage
test-utils only.Source§fn from(fkp: FrankenKeyPackage) -> Self
fn from(fkp: FrankenKeyPackage) -> Self
Source§impl From<KeyPackage> for FrankenKeyPackage
Available on crate features test-utils only.
impl From<KeyPackage> for FrankenKeyPackage
test-utils only.Source§fn from(kp: KeyPackage) -> Self
fn from(kp: KeyPackage) -> Self
Source§impl From<KeyPackage> for MlsMessageOut
impl From<KeyPackage> for MlsMessageOut
Source§fn from(key_package: KeyPackage) -> Self
fn from(key_package: KeyPackage) -> Self
Source§impl From<KeyPackage> for KeyPackageIn
impl From<KeyPackage> for KeyPackageIn
Source§fn from(value: KeyPackage) -> Self
fn from(value: KeyPackage) -> Self
Source§impl From<KeyPackage> for AddProposal
impl From<KeyPackage> for AddProposal
Source§fn from(key_package: KeyPackage) -> AddProposal
fn from(key_package: KeyPackage) -> AddProposal
Source§impl From<KeyPackage> for LeafNode
impl From<KeyPackage> for LeafNode
Source§fn from(key_package: KeyPackage) -> Self
fn from(key_package: KeyPackage) -> Self
Source§impl From<KeyPackageIn> for KeyPackage
Available on crate features test-utils only.
impl From<KeyPackageIn> for KeyPackage
test-utils only.Source§fn from(value: KeyPackageIn) -> Self
fn from(value: KeyPackageIn) -> Self
Source§impl PartialEq for KeyPackage
impl PartialEq for KeyPackage
Source§impl Serialize for KeyPackage
impl Serialize for KeyPackage
Source§impl Serialize for KeyPackage
impl Serialize for KeyPackage
Source§impl Size for KeyPackage
impl Size for KeyPackage
fn tls_serialized_len(&self) -> usize
Source§impl Size for &KeyPackage
impl Size for &KeyPackage
fn tls_serialized_len(&self) -> usize
impl VerifiedStruct for KeyPackage
Auto Trait Implementations§
impl Freeze for KeyPackage
impl RefUnwindSafe for KeyPackage
impl Send for KeyPackage
impl Sync for KeyPackage
impl Unpin for KeyPackage
impl UnsafeUnpin for KeyPackage
impl UnwindSafe for KeyPackage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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