Class Oath
	
	
Oath implementation of the OATH specification for both HOTP and TOTP one time
passwords (RFC4226 and its extension HOTPTimeBased Internet-Draft,
respectively).
See http://www.openauthentication.org
	 
	
		Methods summary
		
		
			| 
				 public 
				
				
				 | 
			#
			__construct( string $secret = null, string $crypto = "sha1" )
				
Construct a new OATH object using the given secret and HMAC hash function 
				
Construct a new OATH object using the given secret and HMAC hash function Parameters
						$secretstring$secret The shared secret
$cryptostring$crypto The crypto system to use during the HMAC calculation
 | 
		
			| 
				 public 
				
				
				 | 
			#
			setSecret( string $secret )
				
Set the secret key to use along with the HMAC calculation 
				
Set the secret key to use along with the HMAC calculation Parameters
						$secretstring$secret The shared secret
 | 
		
			| 
				 public 
				
				
				 | 
			#
			setCrypto( string $crypto )
				
Set the algorithm to use during the HMAC calculation 
				
Set the algorithm to use during the HMAC calculation Parameters
						$cryptostring$crypto The crypto system to use during the HMAC calculation
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			checkHotp( string $otp, integer $counter, integer $vlav = 0 )
				
Checks whether the given one time password is a valid HOTP password using the
given counter and VLAV (Validation Look Ahead Value) 
				
Checks whether the given one time password is a valid HOTP password using the
given counter and VLAV (Validation Look Ahead Value) Parameters
						$otpstring$otp The one time password to validate
$counterinteger$counter The counter value
$vlavinteger$vlav The validation look ahead value
Returns
						booleanTrue if this OTP is valid, false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			checkTotp( string $otp, integer $time )
				
Checks whether the given one time password is a valid TOTP password using the
given time 
				
Checks whether the given one time password is a valid TOTP password using the
given time Parameters
						$otpstring$otp The one time password to validate
$timeinteger$time The time value
Returns
						booleanTrue if this OTP is valid, false otherwise
 
 | 
		
			| 
				 public static
				string
				
				 | 
			#
			hotp( string $key, integer $counter, mixed $digit_length = 6, mixed $crypto = "sha1" )
				
Generate an HOTP pass phrase 
				
Generate an HOTP pass phrase Parameters
						$keystring$key The secret key
$counterinteger$counter The counter value
$digit_lengthmixed$digit_length The length of the resulting pass phrase
$cryptomixed$crypto The algorithm to use in the HMAC calculation
Returns
						stringThe HOTP pass pharse
 
 | 
		
			| 
				 public static
				string
				
				 | 
			#
			totp( string $key, integer $counter, mixed $digit_length = 6, mixed $crypto = "sha1" )
				
Generate an TOTP pass phrase 
				
Generate an TOTP pass phrase Parameters
						$keystring$key The secret key
$counterinteger$counter The counter value (e.g. Unix time)
$digit_lengthmixed$digit_length The length of the resulting pass phrase
$cryptomixed$crypto The algorithm to use in the HMAC calculation
Returns
						stringThe TOTP pass pharse
 
 | 
		
		Magic methods summary