|  | 
| static | create (null|string $secret=null, int $period=self::DEFAULT_PERIOD, string $digest=self::DEFAULT_DIGEST, int $digits=self::DEFAULT_DIGITS, int $epoch=self::DEFAULT_EPOCH, ?ClockInterface $clock=null) | 
|  | 
| static | create (null|string $secret=null, int $period=self::DEFAULT_PERIOD, string $digest=self::DEFAULT_DIGEST, int $digits=self::DEFAULT_DIGITS) | 
|  | 
| static | createFromSecret (string $secret) | 
|  | 
| static | createFromSecret (string $secret, ?ClockInterface $clock=null) | 
|  | 
| static | generate () | 
|  | Create a new OTP object. 
 | 
|  | 
| static | generate (?ClockInterface $clock=null) | 
|  | 
|  | 
| const | DEFAULT_DIGEST = 'sha1' | 
|  | 
| const | DEFAULT_DIGITS = 6 | 
|  | 
| const | DEFAULT_EPOCH = 0 | 
|  | 
| const | DEFAULT_PERIOD = 30 | 
|  | 
◆ at()
      
        
          | OTPHP\TOTP::at | ( | int | $input | ) |  | 
      
 
The OTP at the specified input. 
- Parameters
- 
  
  
Reimplemented from OTPHP\OTP.
 
 
◆ compareOTP()
  
  | 
        
          | OTPHP\OTP::compareOTP | ( | string | $safe, |  
          |  |  | string | $user ) |  | protectedinherited | 
 
- Parameters
- 
  
    | non-empty-string | $safe |  |  | non-empty-string | $user |  |  
 
 
 
◆ expiresIn()
      
        
          | OTPHP\TOTP::expiresIn | ( |  | ) |  | 
      
 
 
◆ filterOptions()
  
  | 
        
          | OTPHP\TOTP::filterOptions | ( | array & | $options | ) |  |  | protected | 
 
- Parameters
- 
  
    | array<non-empty-string,mixed> | $options |  
 
Reimplemented from OTPHP\OTP.
 
 
◆ 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 | ) |  |  | protectedinherited | 
 
The OTP at the specified input. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ generateSecret()
  
  | 
        
          | static OTPHP\OTP::generateSecret | ( |  | ) |  |  | staticfinalprotectedinherited | 
 
 
◆ generateURI()
  
  | 
        
          | OTPHP\OTP::generateURI | ( | string | $type, |  
          |  |  | array | $options ) |  | protectedinherited | 
 
- 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 |  
 
 
 
◆ getEpoch()
◆ 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 |  |  
 
 
 
◆ getParameterMap()
  
  | 
        
          | OTPHP\TOTP::getParameterMap | ( |  | ) |  |  | protected | 
 
- Return values
- 
  
    | array<non-empty-string,callable> |  |  
 
 
 
◆ getParameters()
  
  | 
        
          | OTPHP\OTPInterface::getParameters | ( |  | ) |  |  | inherited | 
 
- Return values
- 
  
    | array<non-empty-string,mixed> |  |  
 
 
 
◆ getPeriod()
      
        
          | OTPHP\TOTP::getPeriod | ( |  | ) |  | 
      
 
Get the period of time for OTP generation (a non-null positive integer, in second). 
Implements OTPHP\TOTPInterface.
 
 
◆ getProvisioningUri()
      
        
          | OTPHP\TOTP::getProvisioningUri | ( |  | ) |  | 
      
 
 
◆ getQrCodeUri()
  
  | 
        
          | OTPHP\OTP::getQrCodeUri | ( | string | $uri, |  
          |  |  | string | $placeholder ) |  | inherited | 
 
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 |  
 
 
 
◆ now()
◆ setDigest()
  
  | 
        
          | OTPHP\OTPInterface::setDigest | ( | string | $digest | ) |  |  | inherited | 
 
 
◆ setEpoch()
      
        
          | OTPHP\TOTP::setEpoch | ( | int | $epoch | ) |  | 
      
 
 
◆ 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 |  |  
 
 
 
◆ setPeriod()
      
        
          | OTPHP\TOTP::setPeriod | ( | int | $period | ) |  | 
      
 
 
◆ setSecret()
  
  | 
        
          | OTPHP\OTPInterface::setSecret | ( | string | $secret | ) |  |  | inherited | 
 
 
◆ verify()
      
        
          | OTPHP\TOTP::verify | ( | string | $otp, | 
        
          |  |  | null|int | $timestamp = null, | 
        
          |  |  | null|int | $leeway = null ) | 
      
 
If no timestamp is provided, the OTP is verified at the actual timestamp. 
When used, the leeway parameter will allow time drift. The passed value is in seconds.
- Parameters
- 
  
    | 0 | positive-int | $timestamp |  |  | null | 0 | positive-int | $leeway |  |  
 
Implements OTPHP\OTPInterface.
 
 
The documentation for this class was generated from the following file:
- admin/tool/mfa/factor/totp/extlib/OTPHP/TOTP.php