Struct core_crypto::prelude::KeyPackage

pub struct KeyPackage { /* private fields */ }
Expand description

The key package struct.

Implementations§

§

impl KeyPackage

pub fn builder() -> KeyPackageBuilder

Create a key package builder.

This is provided for convenience. You can also use [KeyPackageBuilder::new].

pub async fn delete<KeyStore>( &self, backend: &impl OpenMlsCryptoProvider<KeyStoreProvider = KeyStore>, ) -> Result<(), KeyPackageDeleteError<<KeyStore as OpenMlsKeyStore>::Error>>
where KeyStore: OpenMlsKeyStore,

Delete this key package and its private key from the key store.

pub fn extensions(&self) -> &Extensions

Get a reference to the extensions of this key package.

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.

pub fn hash_ref( &self, backend: &impl OpenMlsCrypto, ) -> Result<HashReference, LibraryError>

Compute the KeyPackageRef of this KeyPackage. The KeyPackageRef is used to identify a new member that should get added to a group.

pub fn ciphersuite(&self) -> Ciphersuite

Get the Ciphersuite.

pub fn leaf_node(&self) -> &LeafNode

Get the [LeafNode] reference.

pub fn hpke_init_key(&self) -> &VLBytes

Get the public HPKE init key of this key package.

§

impl KeyPackage

This impl block contains no items.

Crate visible KeyPackage functions.

Trait Implementations§

§

impl Clone for KeyPackage

§

fn clone(&self) -> KeyPackage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for KeyPackage

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for KeyPackage

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<KeyPackage, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl From<KeyPackage> for KeyPackageIn

§

fn from(value: KeyPackage) -> KeyPackageIn

Converts to this type from the input type.
§

impl From<KeyPackageIn> for KeyPackage

§

fn from(value: KeyPackageIn) -> KeyPackage

Converts to this type from the input type.
§

impl MlsEntity for KeyPackage

§

const ID: MlsEntityId = MlsEntityId::KeyPackage

Identifier used to downcast the actual entity within an [OpenMlsKeyStore] method. In case for example you need to select a SQL table depending on the entity type
§

fn downcast<T>(&self) -> Option<&T>
where T: MlsEntity,

§

impl PartialEq for KeyPackage

§

fn eq(&self, other: &KeyPackage) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Serialize for &KeyPackage

§

fn tls_serialize<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Serialize self and write it to the writer. The function returns the number of bytes written to writer.
§

fn tls_serialize_detached(&self) -> Result<Vec<u8>, Error>

Serialize self and return it as a byte vector.
§

impl Serialize for KeyPackage

§

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 KeyPackage

§

fn tls_serialize<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Serialize self and write it to the writer. The function returns the number of bytes written to writer.
§

fn tls_serialize_detached(&self) -> Result<Vec<u8>, Error>

Serialize self and return it as a byte vector.
§

impl SignedStruct<KeyPackageTbs> for KeyPackage

§

fn from_payload(payload: KeyPackageTbs, signature: Signature) -> KeyPackage

Build a signed struct version from the payload struct.
§

impl Size for &KeyPackage

§

impl Size for KeyPackage

§

impl VerifiedStruct<VerifiableKeyPackage> for KeyPackage

§

type SealingType = Seal

This type is used to prevent users of the trait from bypassing verify by simply calling from_verifiable. Seal should be a dummy type defined in a private module as follows: Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,