pub struct LogEncryptor { /* private fields */ }Expand description
Log encryptor for secure log entries
Implementations§
Source§impl LogEncryptor
impl LogEncryptor
Sourcepub fn new(key: &EncryptionKey) -> Result<Self, EncryptionError>
pub fn new(key: &EncryptionKey) -> Result<Self, EncryptionError>
Create a new log encryptor with the given key
Sourcepub fn encrypt(
&self,
plaintext: &str,
entry_id: &str,
) -> Result<EncryptedLogEntry, EncryptionError>
pub fn encrypt( &self, plaintext: &str, entry_id: &str, ) -> Result<EncryptedLogEntry, EncryptionError>
Encrypt a log entry
Sourcepub fn decrypt(
&self,
encrypted: &EncryptedLogEntry,
) -> Result<String, EncryptionError>
pub fn decrypt( &self, encrypted: &EncryptedLogEntry, ) -> Result<String, EncryptionError>
Decrypt a log entry
Sourcepub fn encrypt_batch(
&self,
entries: &[(&str, &str)],
) -> Vec<Result<EncryptedLogEntry, EncryptionError>>
pub fn encrypt_batch( &self, entries: &[(&str, &str)], ) -> Vec<Result<EncryptedLogEntry, EncryptionError>>
Encrypt multiple log entries in batch
Auto Trait Implementations§
impl Freeze for LogEncryptor
impl RefUnwindSafe for LogEncryptor
impl Send for LogEncryptor
impl Sync for LogEncryptor
impl Unpin for LogEncryptor
impl UnwindSafe for LogEncryptor
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