pub struct EncryptionManager { /* private fields */ }Expand description
File-level encryption manager using two-layer envelope encryption.
Uses an async cache for unwrapped KEK bytes to avoid repeated KMS calls.
Implementations§
Source§impl EncryptionManager
impl EncryptionManager
Sourcepub fn builder() -> EncryptionManagerBuilder<((), (), (), (RwLock<HashMap<String, EncryptedKey>>,))>
pub fn builder() -> EncryptionManagerBuilder<((), (), (), (RwLock<HashMap<String, EncryptedKey>>,))>
Create a builder for building EncryptionManager.
On the builder, call .kms_client(...), .key_size(...)(optional), .table_key_id(...) to set the values of the fields.
Finally, call .build() to create the instance of EncryptionManager.
Source§impl EncryptionManager
impl EncryptionManager
Sourcepub fn encrypt(&self, raw_output: OutputFile) -> EncryptedOutputFile
pub fn encrypt(&self, raw_output: OutputFile) -> EncryptedOutputFile
Encrypt a file with AGS1 stream encryption.
Returns an EncryptedOutputFile that transparently encrypts on
write, along with key metadata for later decryption.
Sourcepub async fn encrypt_manifest_list_key_metadata(
&self,
key_metadata: &StandardKeyMetadata,
) -> Result<String>
pub async fn encrypt_manifest_list_key_metadata( &self, key_metadata: &StandardKeyMetadata, ) -> Result<String>
Wrap a manifest list key metadata with a KEK for storage in table metadata.
Stores the resulting wrapped entry (and any newly created KEK) in the
manager’s internal encryption_keys map. Callers persist the full set
at commit time via Self::encryption_keys.
Returns the key_id of the wrapped entry, which should be recorded on
the snapshot as encryption_key_id so readers can locate it later.
Sourcepub async fn decrypt_manifest_list_key_metadata(
&self,
encryption_key_id: &str,
) -> Result<StandardKeyMetadata>
pub async fn decrypt_manifest_list_key_metadata( &self, encryption_key_id: &str, ) -> Result<StandardKeyMetadata>
Decrypt a manifest list key metadata previously wrapped via
Self::encrypt_manifest_list_key_metadata.
Looks up the entry by encryption_key_id (typically read from the
snapshot) in the manager’s encryption_keys map.
Sourcepub fn with_encryption_keys<F, R>(&self, f: F) -> R
pub fn with_encryption_keys<F, R>(&self, f: F) -> R
Borrow the encryption keys held by this manager.
Use at commit time to persist newly created KEKs and wrapped
manifest-list entries into TableMetadata.encryption_keys.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EncryptionManager
impl !RefUnwindSafe for EncryptionManager
impl Send for EncryptionManager
impl Sync for EncryptionManager
impl Unpin for EncryptionManager
impl !UnwindSafe for EncryptionManager
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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> ⓘ
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> ⓘ
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