pub enum CloudCipher {
Encrypted(EncryptionService),
Plaintext,
}Expand description
How a cloud home protects its objects at rest. An Encrypted home seals
every object under the store key (the default); a Plaintext home stores
objects in the clear so the bucket is browsable, and drops the .enc suffix.
Variants§
Encrypted(EncryptionService)
Plaintext
Implementations§
Source§impl CloudCipher
impl CloudCipher
Sourcepub fn for_storage(
storage: HomeStorage,
encryption: Option<EncryptionService>,
) -> Option<CloudCipher>
pub fn for_storage( storage: HomeStorage, encryption: Option<EncryptionService>, ) -> Option<CloudCipher>
The at-rest cipher a home’s storage mode selects: an opaque home seals
under its store key (Encrypted), a browsable home stores in the clear
(Plaintext). The sibling of [BlobPathScheme::for_storage] — together
they map a HomeStorage to its
(path scheme, at-rest cipher) pair.
encryption is the store master service; it is required for (and only
consulted on) an opaque home. None is returned only for an opaque home
with no service (a locked store) — a browsable home is always
Plaintext regardless. A host streaming a Remote blob via
[BlobRangeReader] builds the reader with this cipher so a read applies
the same protection the upload sealed under.
Sourcepub fn seal(&self, plaintext: Vec<u8>, aad_context: &[u8]) -> Vec<u8> ⓘ
pub fn seal(&self, plaintext: Vec<u8>, aad_context: &[u8]) -> Vec<u8> ⓘ
Protect an immutable Store object or mutable membership/key object for storage. Encrypted homes seal under the current store-key generation and prefix that generation in cleartext; plaintext homes return the bytes unchanged.
Sourcepub fn open(
&self,
stored: Vec<u8>,
aad_context: &[u8],
) -> Result<Vec<u8>, EncryptionError>
pub fn open( &self, stored: Vec<u8>, aad_context: &[u8], ) -> Result<Vec<u8>, EncryptionError>
Recover a control object read from storage. Inverse of Self::seal.
Sourcepub fn suffix(&self) -> &'static str
pub fn suffix(&self) -> &'static str
The object-key suffix this cipher implies: .enc for an encrypted home,
empty for a plaintext one. Note "x".strip_suffix("") returns Some("x"),
so the listing parsers strip an empty suffix as a clean no-op.
Sourcepub fn is_plaintext(&self) -> bool
pub fn is_plaintext(&self) -> bool
Whether this is a plaintext (unencrypted) home.
Trait Implementations§
Source§impl Clone for CloudCipher
impl Clone for CloudCipher
Source§fn clone(&self) -> CloudCipher
fn clone(&self) -> CloudCipher
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CloudCipher
impl RefUnwindSafe for CloudCipher
impl Send for CloudCipher
impl Sync for CloudCipher
impl Unpin for CloudCipher
impl UnsafeUnpin for CloudCipher
impl UnwindSafe for CloudCipher
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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