PHP 클래스 OTPHP\TOTP

상속: extends OTP, implements otphp\TOTPInterface
파일 보기 프로젝트 열기: spomky-labs/otphp 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $label, string | null $secret = null, integer $period = 30, string $digest = 'sha1', integer $digits = 6 ) TOTP constructor.
at ( $timestamp )
getPeriod ( )
getProvisioningUri ( )
now ( )
verify ( $otp, $timestamp = null, $window = null ) If no timestamp is provided, the OTP is verified at the actual timestamp {@inheritdoc}

비공개 메소드들

메소드 설명
getTimestamp ( integer | null $timestamp ) : integer
setPeriod ( integer $period ) : self
timecode ( integer $timestamp ) : integer
verifyOtpWithWindow ( string $otp, integer $timestamp, integer $window ) : boolean

메소드 상세

__construct() 공개 메소드

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

at() 공개 메소드

public at ( $timestamp )

getPeriod() 공개 메소드

public getPeriod ( )

getProvisioningUri() 공개 메소드

public getProvisioningUri ( )

now() 공개 메소드

public now ( )

verify() 공개 메소드

If no timestamp is provided, the OTP is verified at the actual timestamp {@inheritdoc}
public verify ( $otp, $timestamp = null, $window = null )