PHP Класс Horde_Secret, horde

Copyright 1999-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Chuck Hagenbuch ([email protected])
Автор: Michael Slusarz ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_cipherCache array Cipher cache.
$_keyCache array Key cache.
$_params array Configuration parameters.

Открытые методы

Метод Описание
__construct ( array $params = [] ) Constructor.
clearKey ( string $keyname = self::DEFAULT_KEY ) : boolean Clears a secret key entry from the current cookie.
getKey ( string $keyname = self::DEFAULT_KEY ) : string Return a secret key, either from a cookie, or if the cookie isn't there, assume we are using a munged version of a known base value.
read ( string $key, $ciphertext ) : string Decrypt a message encrypted with write().
setKey ( string $keyname = self::DEFAULT_KEY ) : string Generate a secret key (for encryption), either using a random string and storing it in a cookie if the user has cookies enabled, or munging some known values if they don't.
write ( string $key, string $message ) : string Take a small piece of data and encrypt it with a key.

Защищенные методы

Метод Описание
_getCipherOb ( string $key ) : Horde_Crypt_Blowfish Returns the cached crypt object.
_setCookie ( string $keyname, string $key ) Sets the cookie with the given keyname/key.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters: - cookie_domain: (string) The cookie domain. - cookie_path: (string) The cookie path. - cookie_ssl: (boolean) Only transmit cookie securely? - session_name: (string) The cookie session name.

_getCipherOb() защищенный Метод

Returns the cached crypt object.
protected _getCipherOb ( string $key ) : Horde_Crypt_Blowfish
$key string The key to use for [de|en]cryption. Only the first 56 bytes of this string is used.
Результат Horde_Crypt_Blowfish The crypt object.

_setCookie() защищенный Метод

Sets the cookie with the given keyname/key.
protected _setCookie ( string $keyname, string $key )
$keyname string The name of the key to set.
$key string The key to use for encryption.

clearKey() публичный Метод

Clears a secret key entry from the current cookie.
public clearKey ( string $keyname = self::DEFAULT_KEY ) : boolean
$keyname string The name of the key to clear.
Результат boolean True if key existed, false if not.

getKey() публичный Метод

Return a secret key, either from a cookie, or if the cookie isn't there, assume we are using a munged version of a known base value.
public getKey ( string $keyname = self::DEFAULT_KEY ) : string
$keyname string The name of the key to get.
Результат string The secret key.

read() публичный Метод

Decrypt a message encrypted with write().
public read ( string $key, $ciphertext ) : string
$key string The key to use for decryption.
Результат string The plaintext message.

setKey() публичный Метод

Generate a secret key (for encryption), either using a random string and storing it in a cookie if the user has cookies enabled, or munging some known values if they don't.
public setKey ( string $keyname = self::DEFAULT_KEY ) : string
$keyname string The name of the key to set.
Результат string The secret key that has been generated.

write() публичный Метод

Take a small piece of data and encrypt it with a key.
public write ( string $key, string $message ) : string
$key string The key to use for encryption.
$message string The plaintext message.
Результат string The ciphertext message.

Описание свойств

$_cipherCache защищенное свойство

Cipher cache.
protected array $_cipherCache
Результат array

$_keyCache защищенное свойство

Key cache.
protected array $_keyCache
Результат array

$_params защищенное свойство

Configuration parameters.
protected array $_params
Результат array