ILIAS  release_7 Revision v7.30-3-g800a261c036
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 15 of file class.ilMd5PasswordEncoder.php.

Member Function Documentation

◆ encodePassword()

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

Exceptions
ilPasswordException

Implements ilPasswordEncoder.

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

References ilBasePasswordEncoder\isPasswordTooLong().

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

21  : string
22  {
23  if ($this->isPasswordTooLong($raw)) {
24  throw new ilPasswordException('Invalid password.');
25  }
26 
27  return md5($raw);
28  }
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 42 of file class.ilMd5PasswordEncoder.php.

Referenced by ilMd5PasswordEncoderTest\testNameShouldBeMd5().

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

◆ isPasswordValid()

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

Exceptions
ilPasswordException

Implements ilPasswordEncoder.

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

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

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

34  : bool
35  {
36  return !$this->isPasswordTooLong($raw) && $this->comparePasswords($encoded, $this->encodePassword($raw, $salt));
37  }
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: