Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • AppFileUtil
  • CommandUtil
  • CrontabUtil
  • EncryptUtil
  • FileUtil
  • Overview
  • Package
  • Class
  • Tree

Class EncryptUtil

Standalone encryption utilities class that can retrieve necessary encryption key/encoding from files.

Package: application\components\util
Author: Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/components/util/EncryptUtil.php
Methods summary
public static
# dependencyCheck( type $throw )

Checks dependencies.

Checks dependencies.

Parameters

$throw
type
$throw Throw an exception if this is set to true and dependencies are missing.

Throws

Exception
public static string|boolean
# genKey( integer $length = 32 )

Generates a new encryption key

Generates a new encryption key

Parameters

$length
integer
$length

Returns

string|boolean
public static
# genIV( )
public
# __construct( mixed $keyFile = null, mixed $IVFile = null, mixed $throw = true )
public string
# __get( mixed $name )

Magic getter that obtains a value for an attribute from a file, or by generating new values.

Magic getter that obtains a value for an attribute from a file, or by generating new values.

The assumption is made: if no storage files are specified, the instance creates new keys for a single usage without complaining, and does not store them. Otherwise, if files are specified but do not exist, a new encryption key is generated (to be stored when EncryptUtil::saveNew() is called).

Returns

string

Throws

Exception
public
# __set( mixed $name, mixed $value )
public
# encrypt( mixed $data )

Encrypts data.

Encrypts data.

public
# decrypt( mixed $data )

Decrypts data.

Decrypts data.

public type
# saveNew( type $safe = true )

Generates and saves an encryption key/IV length in files specified by _keyFile and _IVFile. Throws an exception if the key couldn't be made securely.

Generates and saves an encryption key/IV length in files specified by _keyFile and _IVFile. Throws an exception if the key couldn't be made securely.

Parameters

$safe
type
$safe

Returns

type

Throws

Exception
public static
# secureUniqueIdHash64( mixed $method = null, mixed $hash = null )

Securely generates a random string of 64 characters (hex digits).

Securely generates a random string of 64 characters (hex digits).

Parameters

$method
mixed
$method Forcefully specify a method of generation
$hash
mixed
$hash Forcefully specify a hashing method
Properties summary
public static array $generatedValues array('IV','key')
#
public boolean $canEncrypt
#

Whether all the necessary dependencies are installed to use encryption.

Whether all the necessary dependencies are installed to use encryption.

public type $IVFile
#

File for storing IV length (for encoding purposes)

File for storing IV length (for encoding purposes)

public string $keyFile
#

A file for storing an encryption key

A file for storing an encryption key

X2CRM Documentation API documentation generated by ApiGen 2.8.0