pub fn from_key_package_and_leaf_secret(
        leaf_secret: Secret,
        key_package: &KeyPackage,
        backend: &impl OpenMlsCryptoProvider,
    ) -> Self {
        let leaf_node_secret = derive_leaf_node_secret(&leaf_secret, backend);
        let key_pair = key_package
            .ciphersuite()
            .derive_hpke_keypair(backend.crypto(), &leaf_node_secret);
        let key_package_payload =
            KeyPackagePayload::from_key_package(key_package, key_pair.public.into());
        Self {
            key_package_payload,
            private_key: key_pair.private.into(),
            leaf_secret,
        }
    }
/// Creates a new `KeyPackageBundlePayload` from a given `KeyPackage` and a leaf
/// secret.
/// To get a key package bundle sign the `KeyPackageBundlePayload`.
Creates a new `KeyPackageBundlePayload` from a given `KeyPackage` and a leaf
secret.
To get a key package bundle sign the `KeyPackageBundlePayload`.
Creates a new ` KeyPackageBundlePayload ` from a given ` KeyPackage ` and a leaf secret . To get a key package bundle sign the ` KeyPackageBundlePayload ` .
pub fn from_key_package_and_leaf_secret(
        leaf_secret: Secret,
        key_package: &KeyPackage,
        backend: &impl OpenMlsCryptoProvider,
    ) -> Self {
        let leaf_node_secret = derive_leaf_node_secret(&leaf_secret, backend);
        let key_pair = key_package
            .ciphersuite()
            .derive_hpke_keypair(backend.crypto(), &leaf_node_secret);
        let key_package_payload =
            KeyPackagePayload::from_key_package(key_package, key_pair.public.into());
        Self {
            key_package_payload,
            private_key: key_pair.private.into(),
            leaf_secret,
        }
    }
pub fn from_key_package_and_leaf_secret ( leaf_secret : Secret , key_package : & KeyPackage , backend : & impl OpenMlsCryptoProvider , ) -> Self { let leaf_node_secret = derive_leaf_node_secret ( & leaf_secret , backend ) ; let key_pair = key_package . ciphersuite ( ) . derive_hpke_keypair ( backend . crypto ( ) , & leaf_node_secret ) ; let key_package_payload = KeyPackagePayload :: from_key_package ( key_package , key_pair . public . into ( ) ) ; Self { key_package_payload , private_key : key_pair . private . into ( ) , leaf_secret , } }
Creates a new `KeyPackageBundlePayload` from a given `KeyPackage` and a leaf
secret.
Creates a new ` KeyPackageBundlePayload ` from a given ` KeyPackage ` and a leaf secret .
leaf_secret
Secret
key_package
&KeyPackage
backend
&impl OpenMlsCryptoProvider
leaf_secret
Secret
key_package
&KeyPackage
backend
&impl OpenMlsCryptoProvider