Class EncryptUtilTmp
Copy of Encrypt util with an irrelevant method removed
Methods summary
public static
|
#
dependencyCheck( type $throw )
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
Returns
string|boolean
|
public static
|
|
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 EncryptUtilTmp::saveNew() is called).
Returns
string
Throws
Exception
|
public
|
#
__set( mixed $name, mixed $value )
|
public
|
|
public
|
|
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
Returns
type
Throws
Exception
|
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
|