Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Motp
  • Oath

Class Motp

Mobile One Time Password generator/validator, based on the http://motp.sourceforge.net specification.

Package: blesta
Subpakage: blesta.components.auth.motp
Located at components/auth/motp/motp.php

Methods summary

public
# __construct( string $pin = null, string $secret = null, integer $length = 6 )

Creates a new Motp object with the given seeded values

Creates a new Motp object with the given seeded values

Parameters

$pin
string
$pin The pin to use for this one time password
$secret
string
$secret The secret hash to use for this one time password
$length
integer
$length The length of the one time password
public
# seed( string $pin, string $secret, integer $length = 6 )

Seed the Motp object with the given values

Seed the Motp object with the given values

Parameters

$pin
string
$pin The pin to use for this one time password
$secret
string
$secret The secret hash to use for this one time password
$length
integer
$length The length of the one time password
public boolean
# checkOtp( string $otp, integer $time )

Attempts to find a match for the given one time password with the given time value.

Attempts to find a match for the given one time password with the given time value.

Parameters

$otp
string
$otp A suspected one time password
$time
integer
$time The time around which the given otp should have originated

Returns

boolean
True if the one time password is valid, false otherwise
public string
# opt( integer $time )

Generates a one time password based on the given time and the preset secret and pin.

Generates a one time password based on the given time and the preset secret and pin.

Parameters

$time
integer
$time The time to use as a seed for this one time password

Returns

string
The one time password generated by the given time

See

Motp::seed()
private string
# truncate( string $otp )

Truncates the given one time password, making it suitable for use.

Truncates the given one time password, making it suitable for use.

Parameters

$otp
string
$otp The one time password to truncate

Returns

string
The truncated one time password

Magic methods summary

Properties summary

private string $pin
#

PIN

PIN

private string $secret
#

Shared secret

Shared secret

private integer $length
#

Length of one time password

Length of one time password

private integer $moving_factor
#

Moving factor of MOTP

Moving factor of MOTP

private integer $drift
#

The number of seconds of drift to account for (+/- 3 minutes)

The number of seconds of drift to account for (+/- 3 minutes)

Blesta API documentation generated by ApiGen 2.8.0