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])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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