RecoveryCodes

class \TYPO3\CMS\Core\Authentication\Mfa\Provider\RecoveryCodes

Implementation for generation and validation of recovery codes

Table of Contents

Properties

$mode  : string
$passwordHashFactory  : PasswordHashFactory

Methods

__construct()  : mixed
generatedHashedRecoveryCodes()  : array
Hash the given plain recovery codes with the default hash instance and return them
generatePlainRecoveryCodes()  : array<int, non-empty-string>
Generate given amount of plain recovery codes with the given length
generateRecoveryCodes()  : array
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

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 $codes) : array

Parameters

$codes : array

Return values

array

generatePlainRecoveryCodes()

Generate given amount of plain recovery codes with the given length

public generatePlainRecoveryCodes([int $length = 8 ][, int $quantity = 8 ]) : array<int, non-empty-string>

Parameters

$length : int = 8
$quantity : int = 8

Return values

array<int, non-empty-string>

generateRecoveryCodes()

Generate plain and hashed recovery codes and return them as key/value

public generateRecoveryCodes() : array

Return values

array

verifyRecoveryCode()

Compare given recovery code against all hashed codes and unset the corresponding code on success.

public verifyRecoveryCode(string $recoveryCode, array &$codes) : bool

Parameters

$recoveryCode : string
$codes : array

Return values

bool
On this page