RecoveryCodes
Implementation for generation and validation of recovery codes
should only be used by the TYPO3 Core
Table of Contents
Properties
- $mode : string
- $passwordHashFactory : PasswordHashFactory
Methods
- __construct() : mixed
- generatedHashedRecoveryCodes() : array<string|int, mixed>
- Hash the given plain recovery codes with the default hash instance and return them
- generatePlainRecoveryCodes() : array<string|int, string>
- Generate given amount of plain recovery codes with the given length
- generateRecoveryCodes() : array<string|int, mixed>
- Generate plain and hashed recovery codes and return them as key/value
- verifyRecoveryCode() : bool
- Compare given recovery code against all hashed codes and unset the corresponding code on success.
Properties
$mode
protected
string
$mode
$passwordHashFactory
protected
PasswordHashFactory
$passwordHashFactory
Methods
__construct()
public
__construct(string $mode) : mixed
Parameters
- $mode : string
generatedHashedRecoveryCodes()
Hash the given plain recovery codes with the default hash instance and return them
public
generatedHashedRecoveryCodes(array<string|int, mixed> $codes) : array<string|int, mixed>
Parameters
- $codes : array<string|int, mixed>
Return values
array<string|int, mixed>generatePlainRecoveryCodes()
Generate given amount of plain recovery codes with the given length
public
generatePlainRecoveryCodes([int $length = 8 ][, int $quantity = 8 ]) : array<string|int, string>
Parameters
- $length : int = 8
- $quantity : int = 8
Return values
array<string|int, string>generateRecoveryCodes()
Generate plain and hashed recovery codes and return them as key/value
public
generateRecoveryCodes() : array<string|int, mixed>
Return values
array<string|int, mixed>verifyRecoveryCode()
Compare given recovery code against all hashed codes and unset the corresponding code on success.
public
verifyRecoveryCode(string $recoveryCode, array<string|int, mixed> &$codes) : bool
Parameters
- $recoveryCode : string
- $codes : array<string|int, mixed>