PHP Interface JeremyKendall\Password\PasswordValidatorInterface

Afficher le fichier Open project: jeremykendall/password-validator Interface Usage Examples

Méthodes publiques

Méthode Description
getOptions ( ) : array Gets options for password_hash function
isValid ( string $password, string $passwordHash, string $legacySalt = null, string $identity = null ) : JeremyKendall\Password\Result Validates password and rehashes if necessary.
rehash ( string $password ) : string Hashes password using password_hash. Uses PASSWORD_DEFAULT encryption.
setOptions ( array $options ) Set options for password_hash function

Method Details

getOptions() public méthode

Gets options for password_hash function
public getOptions ( ) : array
Résultat array password_hash options

isValid() public méthode

Validates password and rehashes if necessary.
public isValid ( string $password, string $passwordHash, string $legacySalt = null, string $identity = null ) : JeremyKendall\Password\Result
$password string Password provided by user during login
$passwordHash string User's current hashed password
$legacySalt string OPTIONAL salt used in legacy password hashing
$identity string OPTIONAL unique user identifier
Résultat JeremyKendall\Password\Result

rehash() public méthode

Hashes password using password_hash. Uses PASSWORD_DEFAULT encryption.
public rehash ( string $password ) : string
$password string Plain text password
Résultat string Hashed password

setOptions() public méthode

Set options for password_hash function
See also: http://php.net/password_hash Please, don't create your own salt. Really, just don't. Review the documentation first if you feel you just gotta create your own salt.
public setOptions ( array $options )
$options array password_hash options