Class OTPUser

Description

The main class: this class defines the OTP User

Located in /OTPLib.php (line 19)


	
			
Variable Summary
mixed $atc
mixed $login
mixed $mode
mixed $otpkey
mixed $password
mixed $pin_hash
Method Summary
OTPUser __construct ([string $login = null])
void delete ()
string getOTPWebApp ([string $template = "mobileOTP"])
true isValidOTP (string $otp)
true isValidPassword (string $password)
void save ()
void setOTPKey (string $login, string $password)
void setPassword (string $password)
void setPin (string $pin)
Variables
mixed $atc (line 20)
  • access: public
mixed $login (line 20)
  • access: public
mixed $mode (line 22)
  • access: public
mixed $otpkey (line 20)
  • access: public
mixed $password (line 20)
  • access: public
mixed $pin_hash (line 20)
  • access: public
Methods
Constructor __construct (line 29)

OTPUser's Constructor

  • access: public
OTPUser __construct ([string $login = null])
  • string $login: user's login (optional). if given, will try to build OTPUser object with data from DB
delete (line 109)

Deletes the current user from DB.

  • access: public
void delete ()
getOTPWebApp (line 177)

Build the OTP "WebApp", that can be used on (maybe) any HTML5 web browser. works very well with (Mobile)Safari

  • return: the "WebApp", as a data: URL.
  • access: public
string getOTPWebApp ([string $template = "mobileOTP"])
  • string $template: the css template (optional, by default a CSS that is fine for MobileSafari)
isValidOTP (line 149)

Checks if given OTP is valid. It tries to compute OTP for ATC values in current_atc<ATC<current_ATC+max_offset (where max_offset is in config.ini)

  • return: (if valid) or false (else)
  • access: public
true isValidOTP (string $otp)
  • string $otp: the OTP value to check (it's an integer in a zero-padded string representation)
isValidPassword (line 167)

Checks if the given password is valid. Should be used mostly for enrollment issues.

  • return: (if valid) or false (else)
  • access: public
true isValidPassword (string $password)
  • string $password: the password to check
save (line 92)

Saves the current User to DB. Will create the user in DB or update it automatically.

  • access: public
void save ()
setOTPKey (line 63)

Sets the User's OTP Key. Used only for enrollment/account creation purposes. The provided data are used to diversify the master key.

  • access: public
void setOTPKey (string $login, string $password)
  • string $login: user's login
  • string $password: user's password
setPassword (line 74)

Sets the User's enrollment/static password. Used only for account creation purposes.

  • access: public
void setPassword (string $password)
  • string $password: user's password
setPin (line 83)

Sets the User's OTP PIN. Used only for enrollment/account creation purposes.

  • access: public
void setPin (string $pin)
  • string $pin: user's PIN

Documentation generated on Thu, 09 Apr 2009 21:46:00 +0200 by phpDocumentor 1.4.1