pub struct SecretBundle;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
impl SecretBundle
Sourcepub fn init() -> SecretBundleState
pub fn init() -> SecretBundleState
Initialises empty secret bundle state.
Sourcepub fn from_secrets(secrets: Vec<GroupSecret>) -> SecretBundleState
pub fn from_secrets(secrets: Vec<GroupSecret>) -> SecretBundleState
Initialises secret bundle state from a list of group secrets.
Sourcepub fn generate(
y: &SecretBundleState,
rng: &Rng,
) -> Result<GroupSecret, GroupSecretError>
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.
Sourcepub fn insert(y: SecretBundleState, secret: GroupSecret) -> SecretBundleState
pub fn insert(y: SecretBundleState, secret: GroupSecret) -> SecretBundleState
Inserts secret into bundle, ignoring duplicates.
Sourcepub fn remove(
y: SecretBundleState,
id: &GroupSecretId,
) -> (SecretBundleState, Option<GroupSecret>)
pub fn remove( y: SecretBundleState, id: &GroupSecretId, ) -> (SecretBundleState, Option<GroupSecret>)
Removes secret from bundle.
Sourcepub fn extend(
y: SecretBundleState,
other: SecretBundleState,
) -> SecretBundleState
pub fn extend( y: SecretBundleState, other: SecretBundleState, ) -> SecretBundleState
Merges one bundle with another, ignoring duplicates.