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