[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/horde/framework/Horde/ -> Secret.php (summary)

(no description)

File Size: 224 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Horde_Secret:: (8 methods):
  __construct()
  write()
  read()
  _getCipherOb()
  setKey()
  getKey()
  clearKey()
  _setCookie()


Class: Horde_Secret  - X-Ref

Provides an API for encrypting and decrypting small pieces of data with the
use of a shared key stored in a cookie.

Copyright 1999-2014 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.

__construct($params = array()   X-Ref
Constructor.

param: array $params  Configuration parameters:

write($key, $message)   X-Ref
Take a small piece of data and encrypt it with a key.

param: string $key      The key to use for encryption.
param: string $message  The plaintext message.
return: string  The ciphertext message.

read($key, $ciphertext)   X-Ref
Decrypt a message encrypted with write().

param: string $key      The key to use for decryption.
param: string $message  The ciphertext message.
return: string  The plaintext message.

_getCipherOb($key)   X-Ref
Returns the cached crypt object.

param: string $key  The key to use for [de|en]cryption. Only the first
return: Crypt_Blowfish  The crypt object.

setKey($keyname = self::DEFAULT_KEY)   X-Ref
Generate a secret key (for encryption), either using a random
md5 string and storing it in a cookie if the user has cookies
enabled, or munging some known values if they don't.

param: string $keyname  The name of the key to set.
return: string  The secret key that has been generated.

getKey($keyname = self::DEFAULT_KEY)   X-Ref
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.

param: string $keyname  The name of the key to get.
return: string  The secret key.

clearKey($keyname = self::DEFAULT_KEY)   X-Ref
Clears a secret key entry from the current cookie.

param: string $keyname  The name of the key to clear.
return: boolean  True if key existed, false if not.

_setCookie($keyname, $key)   X-Ref
Sets the cookie with the given keyname/key.

param: string $keyname  The name of the key to set.
param: string $key      The key to use for encryption.



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1