pub trait SecureOperation<T> {
// Required methods
fn execute_secure(self) -> Result<T, Error>;
fn clear_sensitive_data(&mut self);
}
Expand description
Trait for secure cryptographic operations
This trait ensures that sensitive data is properly handled and cleared after operations complete, whether they succeed or fail.
Required Methods§
Sourcefn execute_secure(self) -> Result<T, Error>
fn execute_secure(self) -> Result<T, Error>
Execute the operation securely
This method should:
- Perform the cryptographic operation
- Clear all sensitive intermediate data
- Return the result or error
Sourcefn clear_sensitive_data(&mut self)
fn clear_sensitive_data(&mut self)
Clear all sensitive data associated with this operation
This method is called automatically by execute_secure
but can
also be called manually when needed.