pub struct KeyPackageIn { /* private fields */ }
Expand description
The key package struct.
Implementations§
Source§impl KeyPackageIn
impl KeyPackageIn
Sourcepub fn unverified_credential(&self) -> CredentialWithKey
pub fn unverified_credential(&self) -> CredentialWithKey
Returns a CredentialWithKey
from the unverified payload
Sourcepub fn validate(
self,
crypto: &impl OpenMlsCrypto,
protocol_version: ProtocolVersion,
) -> Result<KeyPackage, KeyPackageVerifyError>
pub fn validate( self, crypto: &impl OpenMlsCrypto, protocol_version: ProtocolVersion, ) -> Result<KeyPackage, KeyPackageVerifyError>
Verify that this key package is valid:
- verify that the signature on this key package is valid
- verify that the signature on the leaf node is valid
- verify that all extensions are supported by the leaf node
- make sure that the lifetime is valid
- make sure that the init key and the encryption key are different
- make sure that the protocol version is valid
Returns a KeyPackage
after having verified the signature or a
KeyPackageVerifyError
otherwise.
Trait Implementations§
Source§impl Clone for KeyPackageIn
impl Clone for KeyPackageIn
Source§fn clone(&self) -> KeyPackageIn
fn clone(&self) -> KeyPackageIn
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for KeyPackageIn
impl Debug for KeyPackageIn
Source§impl<'de> Deserialize<'de> for KeyPackageIn
impl<'de> Deserialize<'de> for KeyPackageIn
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Deserialize for KeyPackageIn
impl Deserialize for KeyPackageIn
Source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
This function deserializes the
bytes
from the provided a std::io::Read
and returns the populated struct. Read moreSource§impl DeserializeBytes for KeyPackageIn
impl DeserializeBytes for KeyPackageIn
Source§impl From<KeyPackage> for KeyPackageIn
impl From<KeyPackage> for KeyPackageIn
Source§fn from(value: KeyPackage) -> Self
fn from(value: KeyPackage) -> Self
Converts to this type from the input type.
Source§impl PartialEq for KeyPackageIn
impl PartialEq for KeyPackageIn
Source§impl Serialize for &KeyPackageIn
impl Serialize for &KeyPackageIn
Source§impl Serialize for KeyPackageIn
impl Serialize for KeyPackageIn
Source§impl Serialize for KeyPackageIn
impl Serialize for KeyPackageIn
Source§impl Size for &KeyPackageIn
impl Size for &KeyPackageIn
fn tls_serialized_len(&self) -> usize
Source§impl Size for KeyPackageIn
impl Size for KeyPackageIn
fn tls_serialized_len(&self) -> usize
impl StructuralPartialEq for KeyPackageIn
Auto Trait Implementations§
impl Freeze for KeyPackageIn
impl RefUnwindSafe for KeyPackageIn
impl Send for KeyPackageIn
impl Sync for KeyPackageIn
impl Unpin for KeyPackageIn
impl UnwindSafe for KeyPackageIn
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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