|
static | createFromSecret (string $secret) |
|
static | generate () |
| Create a new OTP object.
|
|
|
const | DEFAULT_DIGEST = 'sha1' |
|
const | DEFAULT_DIGITS = 6 |
|
◆ at()
OTPHP\OTP::at |
( |
int | $input | ) |
|
◆ compareOTP()
OTPHP\OTP::compareOTP |
( |
string | $safe, |
|
|
string | $user ) |
|
protected |
- Parameters
-
non-empty-string | $safe | |
non-empty-string | $user | |
◆ filterOptions()
OTPHP\OTP::filterOptions |
( |
array & | $options | ) |
|
|
protected |
- Parameters
-
array<non-empty-string,mixed> | $options |
Reimplemented in OTPHP\TOTP.
◆ generate()
static OTPHP\OTPInterface::generate |
( |
| ) |
|
|
staticinherited |
Create a new OTP object.
A random 64 bytes secret will be generated.
◆ generateOTP()
OTPHP\OTP::generateOTP |
( |
int | $input | ) |
|
|
protected |
The OTP at the specified input.
- Parameters
-
- Return values
-
◆ generateSecret()
static OTPHP\OTP::generateSecret |
( |
| ) |
|
|
staticfinalprotected |
◆ generateURI()
OTPHP\OTP::generateURI |
( |
string | $type, |
|
|
array | $options ) |
|
protected |
- Parameters
-
non-empty-string | $type | |
| array<non-empty-string,mixed> | $options |
- Return values
-
◆ getDigest()
OTPHP\OTPInterface::getDigest |
( |
| ) |
|
|
inherited |
- Return values
-
non-empty-string | Digest algorithm used to calculate the OTP. Possible values are 'md5', 'sha1', 'sha256' and 'sha512' |
◆ getDigits()
OTPHP\OTPInterface::getDigits |
( |
| ) |
|
|
inherited |
- Return values
-
positive-int | Number of digits in the OTP |
◆ getIssuer()
OTPHP\OTPInterface::getIssuer |
( |
| ) |
|
|
inherited |
- Return values
-
non-empty-string|null | The issuer |
◆ getLabel()
OTPHP\OTPInterface::getLabel |
( |
| ) |
|
|
inherited |
- Return values
-
non-empty-string|null | The label of the OTP |
◆ getParameter()
OTPHP\OTPInterface::getParameter |
( |
string | $parameter | ) |
|
|
inherited |
- Parameters
-
non-empty-string | $parameter | |
◆ getParameters()
OTPHP\OTPInterface::getParameters |
( |
| ) |
|
|
inherited |
- Return values
-
array<non-empty-string,mixed> | |
◆ getProvisioningUri()
OTPHP\OTPInterface::getProvisioningUri |
( |
| ) |
|
|
inherited |
Get the provisioning URI.
- Return values
-
Implemented in OTPHP\TOTP.
◆ getQrCodeUri()
OTPHP\OTP::getQrCodeUri |
( |
string | $uri, |
|
|
string | $placeholder ) |
Get the provisioning URI.
- Parameters
-
non-empty-string | $uri | The Uri of the QRCode generator with all parameters. This Uri MUST contain a placeholder that will be replaced by the method. |
non-empty-string | $placeholder | the placeholder to be replaced in the QR Code generator URI |
Implements OTPHP\OTPInterface.
◆ getSecret()
OTPHP\OTPInterface::getSecret |
( |
| ) |
|
|
inherited |
- Return values
-
non-empty-string | The secret of the OTP |
◆ hasParameter()
OTPHP\OTPInterface::hasParameter |
( |
string | $parameter | ) |
|
|
inherited |
- Parameters
-
non-empty-string | $parameter | |
◆ isIssuerIncludedAsParameter()
OTPHP\OTPInterface::isIssuerIncludedAsParameter |
( |
| ) |
|
|
inherited |
- Return values
-
bool | If true, the issuer will be added as a parameter in the provisioning URI |
◆ setDigest()
OTPHP\OTPInterface::setDigest |
( |
string | $digest | ) |
|
|
inherited |
◆ setIssuer()
OTPHP\OTPInterface::setIssuer |
( |
string | $issuer | ) |
|
|
inherited |
◆ setLabel()
OTPHP\OTPInterface::setLabel |
( |
string | $label | ) |
|
|
inherited |
- Parameters
-
non-empty-string | $label | The label of the OTP |
◆ setParameter()
OTPHP\OTPInterface::setParameter |
( |
string | $parameter, |
|
|
mixed | $value ) |
|
inherited |
- Parameters
-
non-empty-string | $parameter | |
◆ setSecret()
OTPHP\OTPInterface::setSecret |
( |
string | $secret | ) |
|
|
inherited |
◆ verify()
OTPHP\OTPInterface::verify |
( |
string | $otp, |
|
|
null|int | $input = null, |
|
|
null|int | $window = null ) |
|
inherited |
Verify that the OTP is valid with the specified input.
If no input is provided, the input is set to a default value or false is returned.
- Parameters
-
non-empty-string | $otp | |
null | 0 | positive-int | $input | |
null | 0 | positive-int | $window | |
Implemented in OTPHP\TOTP.
The documentation for this class was generated from the following file:
- admin/tool/mfa/factor/totp/extlib/OTPHP/OTP.php