PHP Интерфейс OTPHP\OTPInterface

Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
at ( integer $input ) : string
getDigest ( ) : string
getDigits ( ) : integer
getIssuer ( ) : string
getLabel ( ) : string
getParameter ( string $parameter ) : null | mixed
getParameters ( ) : array
getProvisioningUri ( ) : string
getQrCodeUri ( string $uri = 'https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl={PROVISIONING_URI}', string $placeholder = '{PROVISIONING_URI}' ) : string
getSecret ( ) : string
hasParameter ( string $parameter ) : boolean
isIssuerIncludedAsParameter ( ) : boolean
setIssuer ( string $issuer )
setIssuerIncludedAsParameter ( boolean $issuer_included_as_parameter )
setParameter ( string $parameter, mixed $value )
verify ( string $otp, integer | null $input = null, integer | null $window = null ) : boolean Verify that the OTP is valid with the specified input.

Описание методов

at() публичный Метод

public at ( integer $input ) : string
$input integer
Результат string Return the OTP at the specified input

getDigest() публичный Метод

public getDigest ( ) : string
Результат string Digest algorithm used to calculate the OTP. Possible values are 'md5', 'sha1', 'sha256' and 'sha512'

getDigits() публичный Метод

public getDigits ( ) : integer
Результат integer Number of digits in the OTP

getIssuer() публичный Метод

public getIssuer ( ) : string
Результат string The issuer

getLabel() публичный Метод

public getLabel ( ) : string
Результат string The label of the OTP

getParameter() публичный Метод

public getParameter ( string $parameter ) : null | mixed
$parameter string
Результат null | mixed

getParameters() публичный Метод

public getParameters ( ) : array
Результат array

getProvisioningUri() публичный Метод

public getProvisioningUri ( ) : string
Результат string Get the provisioning URI

getQrCodeUri() публичный Метод

public getQrCodeUri ( string $uri = 'https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl={PROVISIONING_URI}', string $placeholder = '{PROVISIONING_URI}' ) : string
$uri string The Uri of the QRCode generator with all parameters. By default the Googgle Chart API is used. This Uri MUST contain a placeholder that will be replaced by the method.
$placeholder string The placeholder to be replaced in the QR Code generator URI. Default value is {PROVISIONING_URI}.
Результат string Get the provisioning URI

getSecret() публичный Метод

public getSecret ( ) : string
Результат string The secret of the OTP

hasParameter() публичный Метод

public hasParameter ( string $parameter ) : boolean
$parameter string
Результат boolean

isIssuerIncludedAsParameter() публичный Метод

public isIssuerIncludedAsParameter ( ) : boolean
Результат boolean If true, the issuer will be added as a parameter in the provisioning URI

setIssuer() публичный Метод

public setIssuer ( string $issuer )
$issuer string

setIssuerIncludedAsParameter() публичный Метод

public setIssuerIncludedAsParameter ( boolean $issuer_included_as_parameter )
$issuer_included_as_parameter boolean

setParameter() публичный Метод

public setParameter ( string $parameter, mixed $value )
$parameter string
$value mixed

verify() публичный Метод

If no input is provided, the input is set to a default value or false is returned.
public verify ( string $otp, integer | null $input = null, integer | null $window = null ) : boolean
$otp string
$input integer | null
$window integer | null
Результат boolean