Skip to main content

SecretBundle

Struct SecretBundle 

Source
pub struct SecretBundle;
Available on crate features data_scheme only.
Expand description

Bundle of all secrets used by a group to encrypt and decrypt it’s data.

Peers manage all secrets they generated or learned about in this bundle. New secrets are added to the bundle when a group got updated, a member was added or removed.

Secrets inside the bundle can be removed if the application considers them due, otherwise a bundle will grow in size and no forward secrecy is given.

Implementations§

Source§

impl SecretBundle

Source

pub fn init() -> SecretBundleState

Initialises empty secret bundle state.

Source

pub fn from_secrets(secrets: Vec<GroupSecret>) -> SecretBundleState

Initialises secret bundle state from a list of group secrets.

Source

pub fn generate( y: &SecretBundleState, rng: &Rng, ) -> Result<GroupSecret, GroupSecretError>

Generates and returns a new secret.

To prevent issues with invalid timestamps (too far in the future) of previous secrets, we force our newly generated secret to be the “latest” when needed.

The secret is not yet inserted into the bundle, this needs to be done manually.

Source

pub fn insert(y: SecretBundleState, secret: GroupSecret) -> SecretBundleState

Inserts secret into bundle, ignoring duplicates.

Source

pub fn remove( y: SecretBundleState, id: &GroupSecretId, ) -> (SecretBundleState, Option<GroupSecret>)

Removes secret from bundle.

Source

pub fn extend( y: SecretBundleState, other: SecretBundleState, ) -> SecretBundleState

Merges one bundle with another, ignoring duplicates.

Trait Implementations§

Source§

impl Debug for SecretBundle

Source§

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

Formats the value using the given formatter. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Classify for T

Source§

type Classified = T

Source§

fn classify(self) -> T

Source§

impl<T> Declassify for T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

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

Source§

fn vzip(self) -> V