Trait bonsaidb::local::argon2::password_hash::McfHasher
pub trait McfHasher {
// Required method
fn upgrade_mcf_hash<'a>(
&self,
hash: &'a str
) -> Result<PasswordHash<'a>, Error>;
// Provided method
fn verify_mcf_hash(
&self,
password: &[u8],
mcf_hash: &str
) -> Result<(), Error>
where Self: PasswordVerifier { ... }
}
Expand description
Trait for password hashing algorithms which support the legacy Modular Crypt Format (MCF).
Required Methods§
fn upgrade_mcf_hash<'a>(&self, hash: &'a str) -> Result<PasswordHash<'a>, Error>
fn upgrade_mcf_hash<'a>(&self, hash: &'a str) -> Result<PasswordHash<'a>, Error>
Upgrade an MCF hash to a PHC hash. MCF follow this rough format:
$<id>$<content>
MCF hashes are otherwise largely unstructured and parsed according to algorithm-specific rules so hashers must parse a raw string themselves.
Provided Methods§
fn verify_mcf_hash(&self, password: &[u8], mcf_hash: &str) -> Result<(), Error>where
Self: PasswordVerifier,
fn verify_mcf_hash(&self, password: &[u8], mcf_hash: &str) -> Result<(), Error>where
Self: PasswordVerifier,
Verify a password hash in MCF format against the provided password.