Bitrix API

HotpAlgorithm extends OtpAlgorithm

Table of Contents

Constants

SYNC_WINDOW  = 15000

Methods

__construct()  : mixed
generateOTP()  : string
Main method, generate OTP value for provided counter
generateUri()  : string
Generate provision URI according to KeyUriFormat
getAppScheme()  : string
Return algorithm scheme Mostly used for generate provision URI
getDigest()  : string
Returns digest algorithm used to calculate the OTP.
getDigits()  : int
Return digits (password length)
getSecret()  : string
Return used secret (binary)
getSyncParameters()  : string
Return synchronized user params for provided inputs
getType()  : string
Return OtpAlgorithm type
isTwoCodeRequired()  : bool
Require or not _two_ code for synchronize parameters
setSecret()  : $this
Set new secret
verify()  : array<string|int, mixed>
Verify provided input

Constants

Methods

generateOTP()

Main method, generate OTP value for provided counter

public generateOTP(string|int $counter) : string
Parameters
$counter : string|int

Counter.

Return values
string

generateUri()

Generate provision URI according to KeyUriFormat

public generateUri(mixed $label[, array<string|int, mixed> $opts = [] ]) : string
Parameters
$label : mixed

User label.

$opts : array<string|int, mixed> = []

Additional URI parameters, e.g. ['image' => 'http://example.com/my_logo.png'] .

Tags
inheritDoc
Return values
string

getAppScheme()

Return algorithm scheme Mostly used for generate provision URI

public getAppScheme() : string
Return values
string

getDigest()

Returns digest algorithm used to calculate the OTP.

public getDigest() : string

Mostly used for generate provision URI

Return values
string

getDigits()

Return digits (password length)

public getDigits() : int
Return values
int

getSecret()

Return used secret (binary)

public getSecret() : string
Return values
string

getSyncParameters()

Return synchronized user params for provided inputs

public getSyncParameters(mixed $inputA, mixed $inputB) : string
Parameters
$inputA : mixed

First code.

$inputB : mixed

Second code. Must be provided if current OtpAlgorithm required it (see isTwoCodeRequired).

Tags
inheritDoc
Return values
string

getType()

Return OtpAlgorithm type

public getType() : string
Return values
string

isTwoCodeRequired()

Require or not _two_ code for synchronize parameters

public isTwoCodeRequired() : bool
Return values
bool

setSecret()

Set new secret

public setSecret(string $secret) : $this
Parameters
$secret : string

Secret (binary).

Return values
$this

verify()

Verify provided input

public verify(mixed $input[, mixed $params = null ]) : array<string|int, mixed>
Parameters
$input : mixed

Input received from user.

$params : mixed = null

Synchronized user params, saved for this algorithm (see getSyncParameters).

Tags
inheritDoc
Return values
array<string|int, mixed>

[ bool isSuccess (Valid input or not), string newParams (Updated user params for this OtpAlgorithm) ]


        
On this page

Search results