Struct openmls::key_packages::KeyPackageBundle
source · [−]pub struct KeyPackageBundle { /* private fields */ }
Expand description
A KeyPackageBundle
contains a KeyPackage
, the corresponding private
key, and a leaf secret.
Implementations
sourceimpl KeyPackageBundle
impl KeyPackageBundle
sourcepub fn new(
ciphersuites: &[Ciphersuite],
credential_bundle: &CredentialBundle,
backend: &impl OpenMlsCryptoProvider,
extensions: Vec<Extension>
) -> Result<Self, KeyPackageBundleNewError>
pub fn new(
ciphersuites: &[Ciphersuite],
credential_bundle: &CredentialBundle,
backend: &impl OpenMlsCryptoProvider,
extensions: Vec<Extension>
) -> Result<Self, KeyPackageBundleNewError>
Create a new KeyPackageBundle
with a fresh key pair.
This key package will have the default MLS version.
Use KeyPackageBundle::new_with_version
to get a key package bundle for a specific MLS version.
Note that the capabilities extension gets added automatically, based on the configuration.
Returns a new KeyPackageBundle
or a KeyPackageBundleNewError
.
sourcepub fn new_with_version(
version: ProtocolVersion,
ciphersuites: &[Ciphersuite],
backend: &impl OpenMlsCryptoProvider,
credential_bundle: &CredentialBundle,
extensions: Vec<Extension>
) -> Result<Self, KeyPackageBundleNewError>
pub fn new_with_version(
version: ProtocolVersion,
ciphersuites: &[Ciphersuite],
backend: &impl OpenMlsCryptoProvider,
credential_bundle: &CredentialBundle,
extensions: Vec<Extension>
) -> Result<Self, KeyPackageBundleNewError>
Create a new KeyPackageBundle
with
- a fresh key pair
- the provided MLS version
- the first cipher suite in the
ciphersuites
slice - the provided
extensions
Note that the capabilities extension gets added automatically, based on the configuration.
Returns a new KeyPackageBundle
or a KeyPackageBundleNewError
.
sourcepub fn key_package(&self) -> &KeyPackage
pub fn key_package(&self) -> &KeyPackage
Get a reference to the public part of this bundle, i.e. the KeyPackage
.
sourcepub fn into_parts(self) -> (KeyPackage, (Vec<u8>, Vec<u8>))
pub fn into_parts(self) -> (KeyPackage, (Vec<u8>, Vec<u8>))
Separates the bundle into the KeyPackage
and the HPKE private key and
leaf secret as raw byte vectors.
impl KeyPackageBundle
Crate visible KeyPackageBundle
functions.
Trait Implementations
sourceimpl Clone for KeyPackageBundle
impl Clone for KeyPackageBundle
sourcefn clone(&self) -> KeyPackageBundle
fn clone(&self) -> KeyPackageBundle
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 KeyPackageBundle
impl Debug for KeyPackageBundle
sourceimpl<'de> Deserialize<'de> for KeyPackageBundle
impl<'de> Deserialize<'de> for KeyPackageBundle
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 FromKeyStoreValue for KeyPackageBundle
impl FromKeyStoreValue for KeyPackageBundle
sourceimpl Serialize for KeyPackageBundle
impl Serialize for KeyPackageBundle
sourceimpl ToKeyStoreValue for KeyPackageBundle
impl ToKeyStoreValue for KeyPackageBundle
Auto Trait Implementations
impl RefUnwindSafe for KeyPackageBundle
impl Send for KeyPackageBundle
impl Sync for KeyPackageBundle
impl Unpin for KeyPackageBundle
impl UnwindSafe for KeyPackageBundle
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