PHP Class OTPHP\HOTP

Inheritance: extends OTP, implements otphp\HOTPInterface
Mostrar archivo Open project: spomky-labs/otphp Class Usage Examples

Public Methods

Method Description
__construct ( string $label, string | null $secret = null, integer $counter, string $digest = 'sha1', integer $digits = 6 ) HOTP constructor.
getCounter ( )
getProvisioningUri ( )
verify ( $otp, $counter = null, $window = null ) If the counter is not provided, the OTP is verified at the actual counter.

Private Methods

Method Description
getWindow ( null | integer $window ) : integer
setCounter ( integer $counter )
updateCounter ( integer $counter )
verifyOtpWithWindow ( string $otp, integer $counter, integer $window ) : boolean

Method Details

__construct() public method

HOTP constructor.
public __construct ( string $label, string | null $secret = null, integer $counter, string $digest = 'sha1', integer $digits = 6 )
$label string
$secret string | null
$counter integer
$digest string
$digits integer

getCounter() public method

public getCounter ( )

getProvisioningUri() public method

public getProvisioningUri ( )

verify() public method

public verify ( $otp, $counter = null, $window = null )