Trait PreKeyManager

Source
pub trait PreKeyManager {
    type State: Debug + Serialize + for<'a> Deserialize<'a>;
    type Error: Error;

    // Required methods
    fn prekey_secret(y: &Self::State) -> &SecretKey;
    fn rotate_prekey(
        y: Self::State,
        lifetime: Lifetime,
        rng: &Rng,
    ) -> Result<Self::State, Self::Error>;
    fn prekey_bundle(y: &Self::State) -> LongTermKeyBundle;
    fn generate_onetime_bundle(
        y: Self::State,
        rng: &Rng,
    ) -> Result<(Self::State, OneTimeKeyBundle), Self::Error>;
    fn use_onetime_secret(
        y: Self::State,
        id: OneTimePreKeyId,
    ) -> Result<(Self::State, Option<SecretKey>), Self::Error>;
}
Expand description

Manages our own pre-key secrets to generate public key bundles.

Required Associated Types§

Required Methods§

Source

fn prekey_secret(y: &Self::State) -> &SecretKey

Source

fn rotate_prekey( y: Self::State, lifetime: Lifetime, rng: &Rng, ) -> Result<Self::State, Self::Error>

Source

fn prekey_bundle(y: &Self::State) -> LongTermKeyBundle

Source

fn generate_onetime_bundle( y: Self::State, rng: &Rng, ) -> Result<(Self::State, OneTimeKeyBundle), Self::Error>

Source

fn use_onetime_secret( y: Self::State, id: OneTimePreKeyId, ) -> Result<(Self::State, Option<SecretKey>), Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§