Struct openmls::key_packages::KeyPackage
source · [−]pub struct KeyPackage { /* private fields */ }
Expand description
The key package struct.
Implementations
sourceimpl KeyPackage
impl KeyPackage
sourcepub fn verify(
&self,
backend: &impl OpenMlsCryptoProvider
) -> Result<(), KeyPackageVerifyError>
pub fn verify(
&self,
backend: &impl OpenMlsCryptoProvider
) -> Result<(), KeyPackageVerifyError>
Verify that this key package is valid:
- verify that the signature on this key package is valid
- verify that all mandatory extensions are present
- make sure that the lifetime is valid
Returns
Ok(())
if all checks succeed andKeyPackageError
otherwise
sourcepub fn external_key_id(&self) -> Result<&[u8], ExtensionError>
pub fn external_key_id(&self) -> Result<&[u8], ExtensionError>
Get the external ID of this key package as byte slice.
See ExternalKeyIdExtension
for more details on the external key ID extension.
Returns a ExtensionError
if no external key ID extension is present.
sourcepub fn extensions(&self) -> &[Extension]
pub fn extensions(&self) -> &[Extension]
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 credential(&self) -> &Credential
pub fn credential(&self) -> &Credential
Get a reference to the Credential
.
sourcepub fn hash_ref(
&self,
backend: &impl OpenMlsCrypto
) -> Result<KeyPackageRef, LibraryError>
pub fn hash_ref(
&self,
backend: &impl OpenMlsCrypto
) -> Result<KeyPackageRef, LibraryError>
Compute the KeyPackageRef
of this KeyPackage
.
The KeyPackageRef
is used to identify a member in a group (leaf in
the tree) within MLS.
sourcepub fn ciphersuite(&self) -> Ciphersuite
pub fn ciphersuite(&self) -> Ciphersuite
Get the Ciphersuite
.
impl KeyPackage
Private KeyPackage
functions.
impl KeyPackage
Crate visible KeyPackage
functions.
Trait Implementations
sourceimpl Clone for KeyPackage
impl Clone for KeyPackage
sourcefn clone(&self) -> KeyPackage
fn clone(&self) -> KeyPackage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for KeyPackage
impl Debug for KeyPackage
sourceimpl Deserialize for KeyPackage
impl Deserialize for KeyPackage
sourcefn 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 more
sourceimpl<'de> Deserialize<'de> for KeyPackage
impl<'de> Deserialize<'de> for KeyPackage
sourcefn 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
sourceimpl From<KeyPackage> for LeafNode
impl From<KeyPackage> for LeafNode
sourcefn from(key_package: KeyPackage) -> Self
fn from(key_package: KeyPackage) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<KeyPackage> for KeyPackage
impl PartialEq<KeyPackage> for KeyPackage
sourceimpl Serialize for &KeyPackage
impl Serialize for &KeyPackage
sourceimpl Serialize for KeyPackage
impl Serialize for KeyPackage
sourceimpl Serialize for KeyPackage
impl Serialize for KeyPackage
sourceimpl Size for KeyPackage
impl Size for KeyPackage
fn tls_serialized_len(&self) -> usize
sourceimpl Size for &KeyPackage
impl Size for &KeyPackage
fn tls_serialized_len(&self) -> usize
sourceimpl Verifiable for KeyPackage
impl Verifiable for KeyPackage
sourcefn unsigned_payload(&self) -> Result<Vec<u8>, Error>
fn unsigned_payload(&self) -> Result<Vec<u8>, Error>
Return the unsigned, serialized payload that should be verified.
sourcefn verify<T>(
self,
backend: &impl OpenMlsCryptoProvider,
credential: &Credential
) -> Result<T, CredentialError> where
T: VerifiedStruct<Self>,
fn verify<T>(
self,
backend: &impl OpenMlsCryptoProvider,
credential: &Credential
) -> Result<T, CredentialError> where
T: VerifiedStruct<Self>,
Verifies the payload against the given credential
.
The signature is fetched via the Verifiable::signature()
function and
the payload via Verifiable::unsigned_payload()
. Read more
sourcefn verify_with_key<T>(
self,
backend: &impl OpenMlsCryptoProvider,
signature_public_key: &SignaturePublicKey
) -> Result<T, CredentialError> where
T: VerifiedStruct<Self>,
fn verify_with_key<T>(
self,
backend: &impl OpenMlsCryptoProvider,
signature_public_key: &SignaturePublicKey
) -> Result<T, CredentialError> where
T: VerifiedStruct<Self>,
Verifies the payload against the given SignatureKey
.
The signature is fetched via the Verifiable::signature()
function and
the payload via Verifiable::unsigned_payload()
. Read more
sourcefn verify_no_out(
&self,
backend: &impl OpenMlsCryptoProvider,
credential: &Credential
) -> Result<(), CredentialError>
fn verify_no_out(
&self,
backend: &impl OpenMlsCryptoProvider,
credential: &Credential
) -> Result<(), CredentialError>
Verifies the payload against the given credential
.
The signature is fetched via the Verifiable::signature()
function and
the payload via Verifiable::unsigned_payload()
. Read more
Auto Trait Implementations
impl RefUnwindSafe for KeyPackage
impl Send for KeyPackage
impl Sync for KeyPackage
impl Unpin for KeyPackage
impl UnwindSafe for KeyPackage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more