pub struct SigkeyManager { /* private fields */ }Expand description
T denotes the maximum time period supported and t denotes the current time period.
#[derive(Clone, Debug, Serialize, Deserialize)]
Implementations§
Source§impl SigkeyManager
impl SigkeyManager
pub fn new( T: u128, l: u8, sigkey: Sigkey, db: &mut dyn SigKeyDb, ) -> Result<Self, PixelError>
pub fn load(T: u128, l: u8, t: u128) -> Result<Self, PixelError>
pub fn has_key(t: u128, db: &dyn SigKeyDb) -> bool
pub fn get_key<'a>( t: u128, db: &'a dyn SigKeyDb, ) -> Result<&'a Sigkey, PixelError>
pub fn get_current_key<'a>( &self, db: &'a dyn SigKeyDb, ) -> Result<&'a Sigkey, PixelError>
Sourcepub fn simple_update<R: RngCore + CryptoRng>(
&mut self,
gens: &GeneratorSet,
rng: &mut R,
db: &mut dyn SigKeyDb,
) -> Result<u128, PixelError>
pub fn simple_update<R: RngCore + CryptoRng>( &mut self, gens: &GeneratorSet, rng: &mut R, db: &mut dyn SigKeyDb, ) -> Result<u128, PixelError>
Update time by 1
Sourcepub fn fast_forward_update<R: RngCore + CryptoRng>(
&mut self,
t: u128,
gens: &GeneratorSet,
rng: &mut R,
db: &mut dyn SigKeyDb,
) -> Result<Vec<u128>, PixelError>
pub fn fast_forward_update<R: RngCore + CryptoRng>( &mut self, t: u128, gens: &GeneratorSet, rng: &mut R, db: &mut dyn SigKeyDb, ) -> Result<Vec<u128>, PixelError>
Update time to given t
Auto Trait Implementations§
impl Freeze for SigkeyManager
impl RefUnwindSafe for SigkeyManager
impl Send for SigkeyManager
impl Sync for SigkeyManager
impl Unpin for SigkeyManager
impl UnsafeUnpin for SigkeyManager
impl UnwindSafe for SigkeyManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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