pub struct AlgorithmAgility { /* private fields */ }Expand description
Algorithm agility manager for crypto-agility
Implementations§
Source§impl AlgorithmAgility
impl AlgorithmAgility
Sourcepub fn new(current_version: u32, supported_versions: Vec<u32>) -> Self
pub fn new(current_version: u32, supported_versions: Vec<u32>) -> Self
Create new algorithm agility manager
Sourcepub fn current_version(&self) -> u32
pub fn current_version(&self) -> u32
Get current algorithm version
Sourcepub fn is_supported(&self, version: u32) -> bool
pub fn is_supported(&self, version: u32) -> bool
Check if version is supported
Sourcepub fn get_fallback_version(&self, requested_version: u32) -> Option<u32>
pub fn get_fallback_version(&self, requested_version: u32) -> Option<u32>
Get fallback version if current is not supported
Sourcepub fn set_fallback_enabled(&mut self, enabled: bool)
pub fn set_fallback_enabled(&mut self, enabled: bool)
Enable/disable fallback
Sourcepub fn add_supported_version(&mut self, version: u32)
pub fn add_supported_version(&mut self, version: u32)
Add supported version
Sourcepub fn remove_supported_version(&mut self, version: u32)
pub fn remove_supported_version(&mut self, version: u32)
Remove supported version
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AlgorithmAgility
impl RefUnwindSafe for AlgorithmAgility
impl Send for AlgorithmAgility
impl Sync for AlgorithmAgility
impl Unpin for AlgorithmAgility
impl UnwindSafe for AlgorithmAgility
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