pub struct PrivacyLayer { /* private fields */ }Expand description
Privacy layer for card fingerprint hashing
Implementations§
Source§impl PrivacyLayer
impl PrivacyLayer
Sourcepub async fn new(config: &PrivacyConfig) -> Result<Self, PrivacyError>
pub async fn new(config: &PrivacyConfig) -> Result<Self, PrivacyError>
Initialize privacy layer with pepper from Secrets Manager
Sourcepub fn hash_card_id(&self, card_id: String) -> LoopFingerprint
pub fn hash_card_id(&self, card_id: String) -> LoopFingerprint
Hash a card ID to a Loop fingerprint
§Double-Blind Protocol
This function:
- Takes ownership of
card_id(caller loses access) - Hashes immediately
- Zeroizes the input from memory
- Returns only the fingerprint
After calling this, the raw card_id no longer exists in memory.
Sourcepub fn hash_card_bytes(&self, card_bytes: Vec<u8>) -> LoopFingerprint
pub fn hash_card_bytes(&self, card_bytes: Vec<u8>) -> LoopFingerprint
Hash card ID bytes (for binary inputs)
Sourcepub fn verify(&self, card_id: &str, fingerprint: &LoopFingerprint) -> bool
pub fn verify(&self, card_id: &str, fingerprint: &LoopFingerprint) -> bool
Verify a fingerprint matches a card_id Used for testing/validation only
Auto Trait Implementations§
impl Freeze for PrivacyLayer
impl RefUnwindSafe for PrivacyLayer
impl Send for PrivacyLayer
impl Sync for PrivacyLayer
impl Unpin for PrivacyLayer
impl UnsafeUnpin for PrivacyLayer
impl UnwindSafe for PrivacyLayer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.