ILIAS
release_8 Revision v8.19
|
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... | |
Protected Member Functions | |
init () | |
![]() | |
comparePasswords (string $knownString, string $userString) | |
Compares two passwords. More... | |
isPasswordTooLong (string $password) | |
Protected Attributes | |
string | $costs = '08' |
Definition at line 26 of file class.ilBcryptPhpPasswordEncoder.php.
ilBcryptPhpPasswordEncoder::__construct | ( | array | $config = [] | ) |
array<string,mixed> | $config |
ilPasswordException |
Definition at line 34 of file class.ilBcryptPhpPasswordEncoder.php.
References $config, ILIAS\LTI\ToolProvider\$key, benchmarkCost(), init(), and setCosts().
ilBcryptPhpPasswordEncoder::benchmarkCost | ( | float | $time_target = 0.05 | ) |
ilPasswordException |
Definition at line 58 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 94 of file class.ilBcryptPhpPasswordEncoder.php.
References getCosts(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPhpPasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), ilBcryptPhpPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), and ilBcryptPhpPasswordEncoderTest\testReencodingIsDetectedWhenNecessary().
ilBcryptPhpPasswordEncoder::getCosts | ( | ) |
Definition at line 78 of file class.ilBcryptPhpPasswordEncoder.php.
References $costs.
Referenced by ilBcryptPasswordEncoder\encode(), encodePassword(), requiresReencoding(), ilBcryptPhpPasswordEncoderTest\testCostsCanBeRetrievedWhenCostsAreSet(), and ilBcryptPasswordEncoderTest\testCostsCanBeRetrievedWhenCostsAreSet().
ilBcryptPhpPasswordEncoder::getName | ( | ) |
Returns a unique name/id of the concrete password encoder.
Implements ilPasswordEncoder.
Definition at line 73 of file class.ilBcryptPhpPasswordEncoder.php.
Referenced by ilBcryptPhpPasswordEncoderTest\testNameShouldBeBcryptPhp().
|
protected |
Definition at line 50 of file class.ilBcryptPhpPasswordEncoder.php.
Referenced by __construct().
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 105 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 110 of file class.ilBcryptPhpPasswordEncoder.php.
References getCosts().
Referenced by ilBcryptPhpPasswordEncoderTest\testReencodingIsDetectedWhenNecessary().
ilBcryptPhpPasswordEncoder::setCosts | ( | string | $costs | ) |
Definition at line 83 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().
|
protected |
Definition at line 28 of file class.ilBcryptPhpPasswordEncoder.php.
Referenced by getCosts().