pub struct SecPinHash { /* private fields */ }Expand description
Secure PIN hash storage (32-byte SHA-256 hash)
Provides automatic memory zeroing on drop and constant-time comparison.
Implementations§
Source§impl SecPinHash
impl SecPinHash
Sourcepub fn from_slice(slice: &[u8]) -> Self
pub fn from_slice(slice: &[u8]) -> Self
Create from a slice (panics if not exactly 32 bytes)
Sourcepub fn verify_first_16(&self, expected: &[u8]) -> bool
pub fn verify_first_16(&self, expected: &[u8]) -> bool
Verify first 16 bytes (per CTAP spec for PIN verification)
Sourcepub fn with_bytes<F, R>(&self, f: F) -> R
pub fn with_bytes<F, R>(&self, f: F) -> R
Perform operation with protected scope
Trait Implementations§
Source§impl Clone for SecPinHash
impl Clone for SecPinHash
Source§fn clone(&self) -> SecPinHash
fn clone(&self) -> SecPinHash
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SecPinHash
impl Debug for SecPinHash
Source§impl<'de> Deserialize<'de> for SecPinHash
impl<'de> Deserialize<'de> for SecPinHash
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
Source§impl From<SecPinHash> for SecBytes
impl From<SecPinHash> for SecBytes
Source§fn from(hash: SecPinHash) -> Self
fn from(hash: SecPinHash) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SecPinHash
impl PartialEq for SecPinHash
Source§impl Serialize for SecPinHash
impl Serialize for SecPinHash
Source§impl TryFrom<SecBytes> for SecPinHash
impl TryFrom<SecBytes> for SecPinHash
impl Eq for SecPinHash
Auto Trait Implementations§
impl Freeze for SecPinHash
impl RefUnwindSafe for SecPinHash
impl Send for SecPinHash
impl Sync for SecPinHash
impl Unpin for SecPinHash
impl UnwindSafe for SecPinHash
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