pub struct PanicProtectedKeyStore<K: KeyStore> { /* private fields */ }Expand description
Protected KeyStore wrapper with panic capability
Implementations§
Source§impl<K: KeyStore> PanicProtectedKeyStore<K>
impl<K: KeyStore> PanicProtectedKeyStore<K>
Sourcepub fn new(inner: K, panic_threshold: u64) -> Self
pub fn new(inner: K, panic_threshold: u64) -> Self
Create new panic-protected keystore
§Arguments
inner- The actual keystore to protectpanic_threshold- Number of anomalies before panic
Sourcepub fn set_alert_callback<F>(&mut self, callback: F)
pub fn set_alert_callback<F>(&mut self, callback: F)
Set alert callback for panic events
Sourcepub fn report_anomaly(&self, anomaly: AnomalyEvent)
pub fn report_anomaly(&self, anomaly: AnomalyEvent)
Report anomaly
Sourcepub fn check_timing(&self, operation_name: &str) -> Result<TimingGuard>
pub fn check_timing(&self, operation_name: &str) -> Result<TimingGuard>
Check timing for anomaly detection
Sourcepub fn state(&self) -> PanicState
pub fn state(&self) -> PanicState
Get current state
Sourcepub fn is_destroyed(&self) -> bool
pub fn is_destroyed(&self) -> bool
Is keystore destroyed?
Sourcepub fn anomaly_count(&self) -> u64
pub fn anomaly_count(&self) -> u64
Get anomaly count
Sourcepub fn get_panic_log(&self) -> Vec<PanicLogEntry>
pub fn get_panic_log(&self) -> Vec<PanicLogEntry>
Get panic log
Sourcepub fn emergency_panic(&self, reason: &str)
pub fn emergency_panic(&self, reason: &str)
Manual panic trigger (for testing or emergency)
Trait Implementations§
Source§impl<K: KeyStore> KeyStore for PanicProtectedKeyStore<K>
impl<K: KeyStore> KeyStore for PanicProtectedKeyStore<K>
Source§fn verify(&self, data: &[u8], signature: &[u8]) -> Result<()>
fn verify(&self, data: &[u8], signature: &[u8]) -> Result<()>
Verify signature with the public key Read more
Source§fn public_key_bytes(&self) -> Vec<u8> ⓘ
fn public_key_bytes(&self) -> Vec<u8> ⓘ
Get the public key bytes (for export, verification by others) Read more
Source§fn identifier(&self) -> String
fn identifier(&self) -> String
Get a human-readable identifier for this key store Read more
Auto Trait Implementations§
impl<K> !Freeze for PanicProtectedKeyStore<K>
impl<K> !RefUnwindSafe for PanicProtectedKeyStore<K>
impl<K> Send for PanicProtectedKeyStore<K>
impl<K> Sync for PanicProtectedKeyStore<K>
impl<K> Unpin for PanicProtectedKeyStore<K>
impl<K> !UnwindSafe for PanicProtectedKeyStore<K>
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