pub struct KeyRotationManager { /* private fields */ }Expand description
Key rotation manager
Implementations§
Source§impl KeyRotationManager
impl KeyRotationManager
Sourcepub fn new(config: KeyRotationConfig) -> Self
pub fn new(config: KeyRotationConfig) -> Self
Create a new key rotation manager
Sourcepub async fn register_key(
&self,
key_id: String,
derivation_path: Option<String>,
) -> Result<RotatedKey>
pub async fn register_key( &self, key_id: String, derivation_path: Option<String>, ) -> Result<RotatedKey>
Register a new key
Sourcepub async fn set_active_key(&self, key_id: String) -> Result<()>
pub async fn set_active_key(&self, key_id: String) -> Result<()>
Set the active key
Sourcepub async fn needs_rotation(&self) -> bool
pub async fn needs_rotation(&self) -> bool
Check if rotation is needed
Sourcepub async fn get_active_key(&self) -> Option<RotatedKey>
pub async fn get_active_key(&self) -> Option<RotatedKey>
Get active key
Sourcepub async fn cleanup_expired_keys(&self) -> usize
pub async fn cleanup_expired_keys(&self) -> usize
Clean up expired keys
Auto Trait Implementations§
impl Freeze for KeyRotationManager
impl !RefUnwindSafe for KeyRotationManager
impl Send for KeyRotationManager
impl Sync for KeyRotationManager
impl Unpin for KeyRotationManager
impl !UnwindSafe for KeyRotationManager
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