Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Oath
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

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
The shared secret
$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
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
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
The one time password to validate
$counter
The counter value
$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
The one time password to validate
$time
The time value

Returns

boolean
True if this OTP is valid, false otherwise
public static string
# hotp( string $key, integer $counter, $digit_length = 6, $crypto = 'sha1' )

Generate an HOTP pass phrase

Generate an HOTP pass phrase

Parameters

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

Returns

string
The HOTP pass pharse
public static string
# totp( string $key, integer $counter, $digit_length = 6, $crypto = 'sha1' )

Generate an TOTP pass phrase

Generate an TOTP pass phrase

Parameters

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

Returns

string
The TOTP pass pharse
Blesta API documentation generated by ApiGen