Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • areyouahuman
      • auth
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
        • default
      • exchange
        • rates
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • quickbooks
            • invoice
      • json
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • recaptcha
      • reports
        • aging
          • invoices
        • custom
          • report
        • invoice
          • creation
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • form
      • html
      • javascript
      • xml
    • lib
  • None
  • PHP

Classes

  • Oath

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

Package: blesta\components\auth\oath
Located at components/auth/oath/oath.php

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

$secret
string
$secret The shared secret
$crypto
string
$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

$secret
string
$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

$crypto
string
$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

$otp
string
$otp The one time password to validate
$counter
integer
$counter The counter value
$vlav
integer
$vlav The validation look ahead value

Returns

boolean
True 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

$otp
string
$otp The one time password to validate
$time
integer
$time The time value

Returns

boolean
True 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

$key
string
$key The secret key
$counter
integer
$counter The counter value
$digit_length
mixed
$digit_length The length of the resulting pass phrase
$crypto
mixed
$crypto The algorithm to use in the HMAC calculation

Returns

string
The 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

$key
string
$key The secret key
$counter
integer
$counter The counter value (e.g. Unix time)
$digit_length
mixed
$digit_length The length of the resulting pass phrase
$crypto
mixed
$crypto The algorithm to use in the HMAC calculation

Returns

string
The TOTP pass pharse

Magic methods summary

Blesta API documentation generated by ApiGen 2.8.0