pub struct EventEncryption { /* private fields */ }Expand description
AES-256-GCM encryption implementation for event data
Implementations§
Source§impl EventEncryption
impl EventEncryption
Sourcepub fn new(key_manager: KeyManager) -> Self
pub fn new(key_manager: KeyManager) -> Self
Create new encryption instance with a key manager
Sourcepub fn with_key(key_id: String, key_data: Vec<u8>) -> Result<Self>
pub fn with_key(key_id: String, key_data: Vec<u8>) -> Result<Self>
Create a new encryption instance with a single key
Sourcepub fn encrypt_event_data(&self, data: &EventData) -> Result<EncryptedEventData>
pub fn encrypt_event_data(&self, data: &EventData) -> Result<EncryptedEventData>
Encrypt event data using the default key
Sourcepub fn encrypt_event_data_with_key(
&self,
data: &EventData,
key_id: &str,
) -> Result<EncryptedEventData>
pub fn encrypt_event_data_with_key( &self, data: &EventData, key_id: &str, ) -> Result<EncryptedEventData>
Encrypt event data using a specific key
Sourcepub fn decrypt_event_data(
&self,
encrypted_data: &EncryptedEventData,
) -> Result<EventData>
pub fn decrypt_event_data( &self, encrypted_data: &EncryptedEventData, ) -> Result<EventData>
Decrypt event data
Auto Trait Implementations§
impl Freeze for EventEncryption
impl RefUnwindSafe for EventEncryption
impl Send for EventEncryption
impl Sync for EventEncryption
impl Unpin for EventEncryption
impl UnwindSafe for EventEncryption
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more