pub struct FieldCipher { /* private fields */ }Expand description
Encrypts and decrypts the fields a schema marks cypher, so their values never reach the disk
in the clear.
The additional authenticated data binds each value to its table, its record and its field name, which is what stops a stored value from being moved somewhere it did not belong. Nothing that compaction rewrites takes part in it, so compacting a log needs no key at all.
Implementations§
Source§impl FieldCipher
impl FieldCipher
pub fn new(options: CipherOptions) -> Result<Self, HaysonCipherError>
pub fn write_key_id(&self) -> &str
Sourcepub fn on_missing_key(&self) -> MissingKeyPolicy
pub fn on_missing_key(&self) -> MissingKeyPolicy
What a read of a value sealed under a key this cipher does not hold does — the policy a maintenance pass has to honour as well, so that it never turns a missing key into lost data.
pub fn knows(&self, key_id: &str) -> bool
pub fn encrypt( &self, table: &str, key: &str, field: &str, value: &Value, ) -> String
Trait Implementations§
Source§impl Clone for FieldCipher
impl Clone for FieldCipher
Auto Trait Implementations§
impl Freeze for FieldCipher
impl RefUnwindSafe for FieldCipher
impl Send for FieldCipher
impl Sync for FieldCipher
impl Unpin for FieldCipher
impl UnsafeUnpin for FieldCipher
impl UnwindSafe for FieldCipher
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