Struct core_crypto::prelude::KeyPackageIn
pub struct KeyPackageIn { /* private fields */ }
Expand description
The key package struct.
Implementations§
§impl KeyPackageIn
impl KeyPackageIn
pub fn unverified_credential(&self) -> CredentialWithKey
pub fn unverified_credential(&self) -> CredentialWithKey
Returns a [CredentialWithKey
] from the unverified payload
pub async fn validate(
self,
backend: &impl OpenMlsCryptoProvider,
protocol_version: ProtocolVersion,
group: &PublicGroup,
sender: bool,
) -> Result<KeyPackage, KeyPackageVerifyError>
pub async fn validate( self, backend: &impl OpenMlsCryptoProvider, protocol_version: ProtocolVersion, group: &PublicGroup, sender: bool, ) -> 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.
pub async fn standalone_validate(
self,
backend: &impl OpenMlsCryptoProvider,
protocol_version: ProtocolVersion,
sender: bool,
) -> Result<KeyPackage, KeyPackageVerifyError>
pub async fn standalone_validate( self, backend: &impl OpenMlsCryptoProvider, protocol_version: ProtocolVersion, sender: bool, ) -> Result<KeyPackage, KeyPackageVerifyError>
Verify that this key package is valid disregarding the group it is supposed to be used with.
pub fn credential(&self) -> &Credential
Trait Implementations§
§impl Clone for KeyPackageIn
impl Clone for KeyPackageIn
§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 more§impl Debug for KeyPackageIn
impl Debug for KeyPackageIn
§impl<'de> Deserialize<'de> for KeyPackageIn
impl<'de> Deserialize<'de> for KeyPackageIn
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeyPackageIn, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeyPackageIn, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Deserialize for KeyPackageIn
impl Deserialize for KeyPackageIn
§fn tls_deserialize<R>(bytes: &mut R) -> Result<KeyPackageIn, Error>where
R: Read,
fn tls_deserialize<R>(bytes: &mut R) -> Result<KeyPackageIn, Error>where
R: Read,
This function deserializes the
bytes
from the provided a std::io::Read
and returns the populated struct. Read more§impl From<KeyPackage> for KeyPackageIn
impl From<KeyPackage> for KeyPackageIn
§fn from(value: KeyPackage) -> KeyPackageIn
fn from(value: KeyPackage) -> KeyPackageIn
Converts to this type from the input type.
§impl From<KeyPackageIn> for KeyPackage
impl From<KeyPackageIn> for KeyPackage
§fn from(value: KeyPackageIn) -> KeyPackage
fn from(value: KeyPackageIn) -> KeyPackage
Converts to this type from the input type.
§impl PartialEq for KeyPackageIn
impl PartialEq for KeyPackageIn
§impl Serialize for &KeyPackageIn
impl Serialize for &KeyPackageIn
§impl Serialize for KeyPackageIn
impl Serialize for KeyPackageIn
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl Serialize for KeyPackageIn
impl Serialize for KeyPackageIn
§impl Size for &KeyPackageIn
impl Size for &KeyPackageIn
fn tls_serialized_len(&self) -> usize
§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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read moresource§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