ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMd5PasswordEncoder Class Reference
+ Inheritance diagram for ilMd5PasswordEncoder:
+ Collaboration diagram for ilMd5PasswordEncoder:

Public Member Functions

 encodePassword (string $raw, string $salt)
 
 isPasswordValid (string $encoded, string $raw, string $salt)
 
 getName ()
 
- Public Member Functions inherited from ilBasePasswordEncoder
 isSupportedByRuntime ()
 
 requiresSalt ()
 
 requiresReencoding (string $encoded)
 

Additional Inherited Members

- Data Fields inherited from ilBasePasswordEncoder
const MAX_PASSWORD_LENGTH = 4096
 
- Protected Member Functions inherited from ilBasePasswordEncoder
 comparePasswords (string $knownString, string $userString)
 Compares two passwords. More...
 
 isPasswordTooLong (string $password)
 Checks if the password is too long. More...
 

Detailed Description

Definition at line 14 of file class.ilMd5PasswordEncoder.php.

Member Function Documentation

◆ encodePassword()

ilMd5PasswordEncoder::encodePassword ( string  $raw,
string  $salt 
)

Exceptions
ilPasswordException

Implements ilPasswordEncoder.

Definition at line 20 of file class.ilMd5PasswordEncoder.php.

References ilBasePasswordEncoder\isPasswordTooLong().

Referenced by isPasswordValid(), ilMd5PasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), and ilMd5PasswordEncoderTest\testPasswordShouldBeCorrectlyEncoded().

20  : string
21  {
22  if ($this->isPasswordTooLong($raw)) {
23  throw new ilPasswordException('Invalid password.');
24  }
25 
26  return md5($raw);
27  }
Class for user password exception handling in ILIAS.
isPasswordTooLong(string $password)
Checks if the password is too long.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getName()

ilMd5PasswordEncoder::getName ( )

Implements ilPasswordEncoder.

Definition at line 41 of file class.ilMd5PasswordEncoder.php.

Referenced by ilMd5PasswordEncoderTest\testNameShouldBeMd5().

41  : string
42  {
43  return 'md5';
44  }
+ Here is the caller graph for this function:

◆ isPasswordValid()

ilMd5PasswordEncoder::isPasswordValid ( string  $encoded,
string  $raw,
string  $salt 
)

Exceptions
ilPasswordException

Implements ilPasswordEncoder.

Definition at line 33 of file class.ilMd5PasswordEncoder.php.

References ilBasePasswordEncoder\comparePasswords(), encodePassword(), and ilBasePasswordEncoder\isPasswordTooLong().

Referenced by ilMd5PasswordEncoderTest\testPasswordCanBeVerified(), and ilMd5PasswordEncoderTest\testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength().

33  : bool
34  {
35  return !$this->isPasswordTooLong($raw) && $this->comparePasswords($encoded, $this->encodePassword($raw, $salt));
36  }
comparePasswords(string $knownString, string $userString)
Compares two passwords.
isPasswordTooLong(string $password)
Checks if the password is too long.
encodePassword(string $raw, string $salt)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: