‪TYPO3CMS  11.5
TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory Class Reference

Public Member Functions

PasswordHashInterface get (string $hash, string $mode)
PasswordHashInterface getDefaultHashInstance (string $mode)

Static Public Member Functions

static array getRegisteredSaltedHashingMethods ()

Detailed Description

Factory class to find and return hash instances of given hashed passwords and to find and return default hash instances to hash new passwords.

Definition at line 26 of file PasswordHashFactory.php.

Member Function Documentation

◆ get()

PasswordHashInterface TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory::get ( string  $hash,
string  $mode 

Find a hash class that handles given hash and return an instance of it.

string$hash‪Given hash to find instance for
string$mode‪'FE' for frontend users, 'BE' for backend users
PasswordHashInterface Object that can handle given hash

Definition at line 38 of file PasswordHashFactory.php.

References $GLOBALS.

◆ getDefaultHashInstance()

PasswordHashInterface TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory::getDefaultHashInstance ( string  $mode)

Determine configured default hash method and return an instance of the class representing it.

string$mode‪'FE' for frontend users, 'BE' for backend users
PasswordHashInterface Class instance that is configured as default hash method

Definition at line 88 of file PasswordHashFactory.php.

References $GLOBALS.

◆ getRegisteredSaltedHashingMethods()

static array TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory::getRegisteredSaltedHashingMethods ( )

Returns list of all registered hashing methods. Used eg. in extension configuration to select the default hashing method.


Definition at line 139 of file PasswordHashFactory.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Tests\Unit\Crypto\PasswordHashing\PasswordHashFactoryTest\getRegisteredSaltedHashingMethodsReturnsRegisteredMethods(), and TYPO3\CMS\Core\Tests\Unit\Crypto\PasswordHashing\PasswordHashFactoryTest\getRegisteredSaltedHashingMethodsThrowsExceptionIfNoMethodIsConfigured().