pub struct NonceManager { /* private fields */ }Expand description
Nonce manager for secure nonce handling with collision detection and secure tracking
Implementations§
Source§impl NonceManager
impl NonceManager
Sourcepub fn with_config(config: NonceConfig) -> Self
pub fn with_config(config: NonceConfig) -> Self
Create a new nonce manager with custom configuration
Sourcepub fn generate_nonce(&self) -> Result<Nonce>
pub fn generate_nonce(&self) -> Result<Nonce>
Generate a new nonce
Sourcepub fn validate_nonce(&self, nonce: &Nonce) -> Result<()>
pub fn validate_nonce(&self, nonce: &Nonce) -> Result<()>
Validate a nonce for uniqueness
Sourcepub fn is_nonce_unique(&self, nonce: &Nonce) -> bool
pub fn is_nonce_unique(&self, nonce: &Nonce) -> bool
Check if a nonce is unique (not used before)
Sourcepub fn mark_nonce_used(&self, nonce: &Nonce) -> Result<()>
pub fn mark_nonce_used(&self, nonce: &Nonce) -> Result<()>
Mark a nonce as used (public interface)
Sourcepub fn get_counter(&self) -> u64
pub fn get_counter(&self) -> u64
Get the current counter value
Sourcepub fn reset_counter(&self)
pub fn reset_counter(&self)
Reset the counter (use with caution)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NonceManager
impl RefUnwindSafe for NonceManager
impl Send for NonceManager
impl Sync for NonceManager
impl Unpin for NonceManager
impl UnsafeUnpin for NonceManager
impl UnwindSafe for NonceManager
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