| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace OTPHP; |
| 6 |
|
| 7 |
interface HOTPInterface extends OTPInterface |
| 8 |
{ |
| 9 |
public const DEFAULT_COUNTER = 0; |
| 10 |
|
| 11 |
/** |
| 12 |
* The initial counter (a positive integer). |
| 13 |
*/ |
| 14 |
public function getCounter(): int; |
| 15 |
|
| 16 |
/** |
| 17 |
* Create a new HOTP object. |
| 18 |
* |
| 19 |
* If the secret is null, a random 64 bytes secret will be generated. |
| 20 |
* |
| 21 |
* @param null|non-empty-string $secret |
| 22 |
* @param 0|positive-int $counter |
| 23 |
* @param non-empty-string $digest |
| 24 |
* @param positive-int $digits |
| 25 |
* |
| 26 |
* @deprecated Deprecated since v11.1, use ::createFromSecret or ::generate instead |
| 27 |
*/ |
| 28 |
public static function create( |
| 29 |
null|string $secret = null, |
| 30 |
int $counter = 0, |
| 31 |
string $digest = 'sha1', |
| 32 |
int $digits = 6 |
| 33 |
): self; |
| 34 |
|
| 35 |
/** |
| 36 |
* @deprecated Deprecated since v11.4, use {@see self::withCounter()} instead |
| 37 |
*/ |
| 38 |
public function setCounter(int $counter): void; |
| 39 |
|
| 40 |
public function withCounter(int $counter): self; |
| 41 |
} |