Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Класс OtpAlgorithm
+ Граф наследования:OtpAlgorithm:

Открытые члены

 verify ($input, $params=null)
 
 getSyncParameters ($inputA, $inputB)
 
 isTwoCodeRequired ()
 
 setSecret ($secret)
 
 getSecret ()
 
 generateUri ($label, array $opts=[])
 
 generateOTP ($counter)
 
 getDigest ()
 
 getDigits ()
 
 getType ()
 
 getAppScheme ()
 

Защищенные члены

 isStringsEqual ($expected, $actual)
 

Защищенные статические члены

static toByte ($value)
 

Защищенные данные

 $digest = 'sha1'
 
 $digits = 6
 
 $secret = null
 
 $appScheme = 'otpauth'
 
 $requireTwoCode = true
 

Статические защищенные данные

static $type = 'undefined'
 

Подробное описание

См. определение в файле otpalgorithm.php строка 9

Методы

◆ generateOTP()

generateOTP ( $counter)

Main method, generate OTP value for provided counter

Аргументы
string | int$counterCounter.
Возвращает
string

См. определение в файле otpalgorithm.php строка 125

◆ generateUri()

generateUri ( $label,
array $opts = [] )

Generate provision URI according to KeyUriFormat

string $label User label. array $opts Additional URI parameters, e.g. ['image' => 'http://example.com/my_logo.png'] . ArgumentTypeException string

Переопределяется в HotpAlgorithm и TotpAlgorithm.

См. определение в файле otpalgorithm.php строка 88

◆ getAppScheme()

getAppScheme ( )

Return algorithm scheme Mostly used for generate provision URI

Возвращает
string

См. определение в файле otpalgorithm.php строка 232

◆ getDigest()

getDigest ( )

Returns digest algorithm used to calculate the OTP. Mostly used for generate provision URI

Возвращает
string

См. определение в файле otpalgorithm.php строка 201

◆ getDigits()

getDigits ( )

Return digits (password length)

Возвращает
int

См. определение в файле otpalgorithm.php строка 211

◆ getSecret()

getSecret ( )

Return used secret (binary)

Возвращает
string

См. определение в файле otpalgorithm.php строка 74

◆ getSyncParameters()

getSyncParameters ( $inputA,
$inputB )
abstract

Return synchronized user params for provided inputs

Аргументы
string$inputAFirst code.
string | null$inputBSecond code. Must be provided if current OtpAlgorithm required it (see isTwoCodeRequired).
Возвращает
string
Исключения
OtpException

Переопределяется в HotpAlgorithm и TotpAlgorithm.

◆ getType()

getType ( )

Return OtpAlgorithm type

Возвращает
string

См. определение в файле otpalgorithm.php строка 221

◆ isStringsEqual()

isStringsEqual ( $expected,
$actual )
protected

A timing safe comparison method

Аргументы
string$expectedExpected string (e.g. input from user).
string$actualActual string (e.g. generated password).
Возвращает
bool
Исключения
ArgumentTypeException

См. определение в файле otpalgorithm.php строка 170

◆ isTwoCodeRequired()

isTwoCodeRequired ( )

Require or not two code for synchronize parameters

Возвращает
bool

См. определение в файле otpalgorithm.php строка 45

◆ setSecret()

setSecret ( $secret)

Set new secret

Аргументы
string$secretSecret (binary).
Возвращает
$this

См. определение в файле otpalgorithm.php строка 56

◆ toByte()

static toByte ( $value)
staticprotected

Convert value to byte string with padding

Аргументы
string | int$valueValue for convert. Must be unsigned integer, e.g. 123, '123', '0x7b', etc.
Возвращает
string

См. определение в файле otpalgorithm.php строка 150

◆ verify()

verify ( $input,
$params = null )
abstract

Verify provided input

Аргументы
string$inputInput received from user.
string$paramsSynchronized user params, saved for this algorithm (see getSyncParameters).
Возвращает
array [ bool isSuccess (Valid input or not), string newParams (Updated user params for this OtpAlgorithm) ]

Переопределяется в HotpAlgorithm.

Данные класса

◆ $appScheme

$appScheme = 'otpauth'
protected

См. определение в файле otpalgorithm.php строка 15

◆ $digest

$digest = 'sha1'
protected

См. определение в файле otpalgorithm.php строка 12

◆ $digits

$digits = 6
protected

См. определение в файле otpalgorithm.php строка 13

◆ $requireTwoCode

$requireTwoCode = true
protected

См. определение в файле otpalgorithm.php строка 16

◆ $secret

$secret = null
protected

См. определение в файле otpalgorithm.php строка 14

◆ $type

$type = 'undefined'
staticprotected

См. определение в файле otpalgorithm.php строка 11