Class PasswordHashStrategy
Class PasswordHashStrategy
-
PasswordHashStrategy
implements
AuthStrategyInterface
Methods summary
public
boolean
|
#
verify( StringType $password, NonEmptyStringType $hash, AuthStrategyCollection $alternativeAlgorithmCollection = null )
Verifies a given password by its stored hash from the current hashing algorithm.
Verifies a given password by its stored hash from the current hashing algorithm.
Parameters
- $password
- Password that should be verified.
- $hash
- Stored Hash of a password.
- $alternativeAlgorithmCollection
- Collection of alternative hashing algorithms.
Returns
boolean Returns true if $password matches $hash, false otherwise.
Implementation of
|
public
string
|
#
getHash( StringType $password )
Generates a hash by given password string.
Generates a hash by given password string.
Parameters
- $password
- String that should be hashed.
Returns
string Resulting hash.
Throws
RuntimeException if password_hash() could not create a hash.
Implementation of
|
public
string
|
#
getRehashedPassword( StringType $password, NonEmptyStringType $hash, AuthStrategyCollection $alternativeAlgorithmCollection = null )
Returns a rehashed password hash if it does not match the currently used hashing algorithm.
Returns a rehashed password hash if it does not match the currently used hashing algorithm.
Parameters
- $password
Password that should be rehashed by a new
algorithm.
- $hash
- Current password hash.
- $alternativeAlgorithmCollection
- Collection of alternative hashing algorithms.
Returns
string The new password hash.
Implementation of
|