pub struct ShaCrypt { /* private fields */ }Available on crate feature
password-hash only.Expand description
SHA-crypt type for use with the PasswordHasher and PasswordVerifier traits, which can
produce and verify password hashes in Modular Crypt Format.
Implementations§
Trait Implementations§
Source§impl CustomizedPasswordHasher<PasswordHash> for ShaCrypt
impl CustomizedPasswordHasher<PasswordHash> for ShaCrypt
Source§fn hash_password_customized(
&self,
password: &[u8],
salt: &[u8],
alg_id: Option<&str>,
version: Option<Version>,
params: Params,
) -> Result<PasswordHash>
fn hash_password_customized( &self, password: &[u8], salt: &[u8], alg_id: Option<&str>, version: Option<Version>, params: Params, ) -> Result<PasswordHash>
Compute a [
PasswordHash] from the provided password using an
explicit set of customized algorithm parameters as opposed to the
defaults. Read moreSource§impl PasswordHasher<PasswordHash> for ShaCrypt
impl PasswordHasher<PasswordHash> for ShaCrypt
Source§fn hash_password_with_salt(
&self,
password: &[u8],
salt: &[u8],
) -> Result<PasswordHash>
fn hash_password_with_salt( &self, password: &[u8], salt: &[u8], ) -> Result<PasswordHash>
Compute the hash
H from the given password and salt, potentially using configuration
stored in &self for the parameters, or otherwise the recommended defaults. Read moreSource§fn hash_password(&self, password: &[u8]) -> Result<H, Error>
fn hash_password(&self, password: &[u8]) -> Result<H, Error>
Available on crate feature
getrandom only.Compute the hash
H from the given password, potentially using configuration stored in
&self for the parameters, or otherwise the recommended defaults. Read moreSource§fn hash_password_with_rng<R>(
&self,
rng: &mut R,
password: &[u8],
) -> Result<H, Error>where
R: TryCryptoRng + ?Sized,
fn hash_password_with_rng<R>(
&self,
rng: &mut R,
password: &[u8],
) -> Result<H, Error>where
R: TryCryptoRng + ?Sized,
Available on crate feature
rand_core only.Compute the hash
H from the given password, potentially using configuration stored in
&self for the parameters, or otherwise the recommended defaults. Read moreSource§impl PasswordVerifier<PasswordHash> for ShaCrypt
impl PasswordVerifier<PasswordHash> for ShaCrypt
Source§fn verify_password(&self, password: &[u8], hash: &PasswordHash) -> Result<()>
fn verify_password(&self, password: &[u8], hash: &PasswordHash) -> Result<()>
Compute this password hashing function against the provided password
using the parameters from the provided password hash and see if the
computed output matches.
Source§impl PasswordVerifier<PasswordHashRef> for ShaCrypt
impl PasswordVerifier<PasswordHashRef> for ShaCrypt
Source§fn verify_password(&self, password: &[u8], hash: &PasswordHashRef) -> Result<()>
fn verify_password(&self, password: &[u8], hash: &PasswordHashRef) -> Result<()>
Compute this password hashing function against the provided password
using the parameters from the provided password hash and see if the
computed output matches.
Source§impl PasswordVerifier<str> for ShaCrypt
impl PasswordVerifier<str> for ShaCrypt
impl Copy for ShaCrypt
impl Eq for ShaCrypt
impl StructuralPartialEq for ShaCrypt
Auto Trait Implementations§
impl Freeze for ShaCrypt
impl RefUnwindSafe for ShaCrypt
impl Send for ShaCrypt
impl Sync for ShaCrypt
impl Unpin for ShaCrypt
impl UnwindSafe for ShaCrypt
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