pub enum FieldProtection {
None,
Sha256,
Hmac,
Rsa,
}Expand description
How a registry field is transformed before hitting disk.
Variants§
None
Sha256
One-way SHA-256. Equality search keeps working (probe is hashed too);
the plaintext is never stored. No key to manage — but the digest is
deterministic and unsalted, so low-entropy values (SSNs, phone
numbers, …) can be brute-forced by anyone with disk access; prefer
FieldProtection::Hmac for those.
Hmac
One-way HMAC-SHA-256 keyed with crate::KeyRing::with_hmac_key.
Equality search keeps working (probes are MACed with the same key);
without the key the stored digests cannot be brute-forced.
Rsa
Hybrid AES-256-GCM + RSA-OAEP(SHA-256) with the store’s public key. Decryptable with the private key, but not searchable.
Trait Implementations§
Source§impl Clone for FieldProtection
impl Clone for FieldProtection
Source§fn clone(&self) -> FieldProtection
fn clone(&self) -> FieldProtection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FieldProtection
Source§impl Debug for FieldProtection
impl Debug for FieldProtection
Source§impl<'de> Deserialize<'de> for FieldProtection
impl<'de> Deserialize<'de> for FieldProtection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FieldProtection
Source§impl PartialEq for FieldProtection
impl PartialEq for FieldProtection
Source§fn eq(&self, other: &FieldProtection) -> bool
fn eq(&self, other: &FieldProtection) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FieldProtection
impl Serialize for FieldProtection
impl StructuralPartialEq for FieldProtection
Auto Trait Implementations§
impl Freeze for FieldProtection
impl RefUnwindSafe for FieldProtection
impl Send for FieldProtection
impl Sync for FieldProtection
impl Unpin for FieldProtection
impl UnsafeUnpin for FieldProtection
impl UnwindSafe for FieldProtection
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