Trait SecureOperation

Source
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§

Source

fn execute_secure(self) -> Result<T, Error>

Execute the operation securely

This method should:

  1. Perform the cryptographic operation
  2. Clear all sensitive intermediate data
  3. Return the result or error
Source

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.

Implementors§