interface PasswordEncoderInterface

PasswordEncoderInterface is the interface for all encoders.

Methods

string
encodePassword(string $raw, string $salt)

Encodes the raw password.

bool
isPasswordValid(string $encoded, string $raw, string $salt)

Checks a raw password against an encoded password.

Details

at line 34
string encodePassword(string $raw, string $salt)

Encodes the raw password.

Parameters

string $raw The password to encode
string $salt The salt

Return Value

string The encoded password

Exceptions

BadCredentialsException If the raw password is invalid, e.g. excessively long
InvalidArgumentException If the salt is invalid

at line 47
bool isPasswordValid(string $encoded, string $raw, string $salt)

Checks a raw password against an encoded password.

Parameters

string $encoded An encoded password
string $raw A raw password
string $salt The salt

Return Value

bool true if the password is valid, false otherwise

Exceptions

InvalidArgumentException If the salt is invalid