pub struct EncryptionLayer { /* private fields */ }Expand description
Zero-knowledge encryption layer with per-tenant key derivation.
Holds a derived encryption key (zeroized on drop) and the
ZeroKnowledgeEncryptor from cachekit-core for AES-256-GCM operations.
L1 stores ciphertext, not plaintext — the zero-knowledge property is preserved across all cache layers.
Implementations§
Source§impl EncryptionLayer
impl EncryptionLayer
Sourcepub fn encrypt(
&self,
plaintext: &[u8],
cache_key: &str,
) -> Result<Vec<u8>, CachekitError>
pub fn encrypt( &self, plaintext: &[u8], cache_key: &str, ) -> Result<Vec<u8>, CachekitError>
Encrypt plaintext with AAD bound to the cache key.
Output format: [nonce(12)][ciphertext + auth_tag(16)]
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EncryptionLayer
impl RefUnwindSafe for EncryptionLayer
impl Send for EncryptionLayer
impl Sync for EncryptionLayer
impl Unpin for EncryptionLayer
impl UnsafeUnpin for EncryptionLayer
impl UnwindSafe for EncryptionLayer
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