ILIAS
trunk Revision v11.0_alpha-1761-g6dbbfa7b760
|
Public Member Functions | |
__construct (array $config=[]) | |
benchmarkCost (float $time_target=0.05) | |
getName () | |
Returns a unique name/id of the concrete password encoder. More... | |
getCosts () | |
setCosts (string $costs) | |
encodePassword (string $raw, string $salt) | |
Encodes the raw password. More... | |
isPasswordValid (string $encoded, string $raw, string $salt) | |
Checks a raw password against an encoded password. More... | |
requiresReencoding (string $encoded) | |
Returns whether the encoded password needs to be re-encoded. More... | |
![]() | |
isSupportedByRuntime () | |
Returns whether the encoder is supported by the runtime (PHP, HHVM, ...) More... | |
requiresSalt () | |
Returns whether the encoder requires a salt. More... | |
requiresReencoding (string $encoded) | |
Returns whether the encoded password needs to be re-encoded. More... | |
Private Attributes | |
const | COST = 'cost' |
string | $costs = '08' |
Additional Inherited Members | |
![]() | |
comparePasswords (string $knownString, string $userString) | |
Compares two passwords. More... | |
isPasswordTooLong (string $password) | |
Definition at line 26 of file class.ilBcryptPhpPasswordEncoder.php.
ilBcryptPhpPasswordEncoder::__construct | ( | array | $config = [] | ) |
array<string,mixed> | $config |
ilPasswordException |
Definition at line 36 of file class.ilBcryptPhpPasswordEncoder.php.
References benchmarkCost(), and setCosts().
ilBcryptPhpPasswordEncoder::benchmarkCost | ( | float | $time_target = 0.05 | ) |
ilPasswordException |
Definition at line 54 of file class.ilBcryptPhpPasswordEncoder.php.
Referenced by __construct(), and ilBcryptPhpPasswordEncoderTest\testCostsCanBeDeterminedDynamically().
ilBcryptPhpPasswordEncoder::encodePassword | ( | string | $raw, |
string | $salt | ||
) |
Encodes the raw password.
string | $raw | The password to encode |
string | $salt | The salt |
Implements ilPasswordEncoder.
Definition at line 90 of file class.ilBcryptPhpPasswordEncoder.php.
References ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPhpPasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), ilBcryptPhpPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), and ilBcryptPhpPasswordEncoderTest\testReencodingIsDetectedWhenNecessary().
ilBcryptPhpPasswordEncoder::getCosts | ( | ) |
Definition at line 74 of file class.ilBcryptPhpPasswordEncoder.php.
References $costs.
Referenced by ilBcryptPasswordEncoder\encode(), ilBcryptPhpPasswordEncoderTest\testCostsCanBeRetrievedWhenCostsAreSet(), and ilBcryptPasswordEncoderTest\testCostsCanBeRetrievedWhenCostsAreSet().
ilBcryptPhpPasswordEncoder::getName | ( | ) |
Returns a unique name/id of the concrete password encoder.
Implements ilPasswordEncoder.
Definition at line 69 of file class.ilBcryptPhpPasswordEncoder.php.
Referenced by ilBcryptPhpPasswordEncoderTest\testNameShouldBeBcryptPhp().
ilBcryptPhpPasswordEncoder::isPasswordValid | ( | string | $encoded, |
string | $raw, | ||
string | $salt | ||
) |
Checks a raw password against an encoded password.
The raw password has to be injected into the encoder instance before.
string | $encoded | An encoded password |
string | $raw | A raw password |
string | $salt | The salt, may be empty |
Implements ilPasswordEncoder.
Definition at line 101 of file class.ilBcryptPhpPasswordEncoder.php.
Referenced by ilBcryptPhpPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), and ilBcryptPhpPasswordEncoderTest\testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength().
ilBcryptPhpPasswordEncoder::requiresReencoding | ( | string | $encoded | ) |
Returns whether the encoded password needs to be re-encoded.
Implements ilPasswordEncoder.
Definition at line 106 of file class.ilBcryptPhpPasswordEncoder.php.
Referenced by ilBcryptPhpPasswordEncoderTest\testReencodingIsDetectedWhenNecessary().
ilBcryptPhpPasswordEncoder::setCosts | ( | string | $costs | ) |
Definition at line 79 of file class.ilBcryptPhpPasswordEncoder.php.
References ILIAS\Repository\int().
Referenced by __construct(), ilBcryptPhpPasswordEncoderTest\testCostsCanBeRetrievedWhenCostsAreSet(), ilBcryptPasswordEncoderTest\testCostsCanBeRetrievedWhenCostsAreSet(), ilBcryptPhpPasswordEncoderTest\testCostsCanBeSetInRange(), ilBcryptPasswordEncoderTest\testCostsCanBeSetInRange(), ilBcryptPhpPasswordEncoderTest\testCostsCannotBeSetAboveRange(), ilBcryptPasswordEncoderTest\testCostsCannotBeSetAboveRange(), ilBcryptPhpPasswordEncoderTest\testCostsCannotBeSetBelowRange(), ilBcryptPasswordEncoderTest\testCostsCannotBeSetBelowRange(), ilBcryptPhpPasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), ilBcryptPhpPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), ilBcryptPhpPasswordEncoderTest\testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength(), ilBcryptPasswordEncoderTest\testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength(), and ilBcryptPhpPasswordEncoderTest\testReencodingIsDetectedWhenNecessary().
|
private |
Definition at line 30 of file class.ilBcryptPhpPasswordEncoder.php.
Referenced by getCosts().
|
private |
Definition at line 28 of file class.ilBcryptPhpPasswordEncoder.php.