PHP Class Webiny\Component\Security\Encoder\Encoder

This class loads the defined encoder and uses it to create a hash from the submitted password and verifies if it matches the password from the user provider.
Inheritance: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\StdLib\FactoryLoaderTrait
Afficher le fichier Open project: Webiny/Framework Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $driver, array | null $params = null )
createPasswordHash ( string $password ) : string Create a hash for the given password.
verifyPasswordHash ( string $password, string $hash ) : boolean Verify if the $password matches the $hash.

Method Details

__construct() public méthode

public __construct ( string $driver, array | null $params = null )
$driver string Name of the encoder provider class.
$params array | null Optional encoder params.

createPasswordHash() public méthode

Create a hash for the given password.
public createPasswordHash ( string $password ) : string
$password string
Résultat string Password hash.

verifyPasswordHash() public méthode

Verify if the $password matches the $hash.
public verifyPasswordHash ( string $password, string $hash ) : boolean
$password string
$hash string
Résultat boolean True if $password matches $hash. Otherwise false is returned.