Auth_OpenID_Association 클래스 참조

모든 멤버 목록

Public 멤버 함수

 fromExpiresIn ($expires_in, $handle, $secret, $assoc_type)
 Auth_OpenID_Association ($handle, $secret, $issued, $lifetime, $assoc_type)
 getExpiresIn ($now=null)
 equal ($other)
 serialize ()
 deserialize ($class_name, $assoc_s)
 sign ($pairs)
 signDict ($fields, $data, $prefix= 'openid.')
 addSignature ($fields, &$data, $prefix= 'openid.')
 checkSignature ($data, $prefix= 'openid.')

Public 속성

 $SIG_LENGTH = 20
 $assoc_keys

상세한 설명

Association.php 파일의 39 번째 라인에서 정의되었습니다.


멤버 함수 문서화

Auth_OpenID_Association::addSignature ( fields,
&$  data,
prefix = 'openid.' 
)

Add a signature to an array of fields

private

Association.php 파일의 283 번째 라인에서 정의되었습니다.

다음을 참조함 : signDict().

00284     {
00285         $sig = $this->signDict($fields, $data, $prefix);
00286         $signed = implode(",", $fields);
00287         $data[$prefix . 'sig'] = $sig;
00288         $data[$prefix . 'signed'] = $signed;
00289     }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

Auth_OpenID_Association::Auth_OpenID_Association ( handle,
secret,
issued,
lifetime,
assoc_type 
)

This is the standard constructor for creating an association. The library should create all of the necessary associations, so this constructor is not part of the external API.

private

매개변수:
string $handle This is the handle the server gave this association.
string $secret This is the shared secret the server generated for this association.
integer $issued This is the time this association was issued, in seconds since 00:00 GMT, January 1, 1970. (ie, a unix timestamp)
integer $lifetime This is the amount of time this association is good for, measured in seconds since the association was issued.
string $assoc_type This is the type of association this instance represents. The only valid value of this field at this time is 'HMAC-SHA1', but new types may be defined in the future.

Association.php 파일의 121 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : fromExpiresIn().

00123     {
00124         if ($assoc_type != 'HMAC-SHA1') {
00125             $fmt = 'HMAC-SHA1 is the only supported association type (got %s)';
00126             trigger_error(sprintf($fmt, $assoc_type), E_USER_ERROR);
00127         }
00128 
00129         $this->handle = $handle;
00130         $this->secret = $secret;
00131         $this->issued = $issued;
00132         $this->lifetime = $lifetime;
00133         $this->assoc_type = $assoc_type;
00134     }

Auth_OpenID_Association::checkSignature ( data,
prefix = 'openid.' 
)

Confirm that the signature of these fields matches the signature contained in the data

private

Association.php 파일의 297 번째 라인에서 정의되었습니다.

다음을 참조함 : signDict().

00298     {
00299         $signed = $data[$prefix . 'signed'];
00300         $fields = explode(",", $signed);
00301         $expected_sig = $this->signDict($fields, $data, $prefix);
00302         $request_sig = $data[$prefix . 'sig'];
00303 
00304         return ($request_sig == $expected_sig);
00305     }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

Auth_OpenID_Association::deserialize ( class_name,
assoc_s 
)

Parse an association as stored by serialize(). This is the inverse of serialize.

매개변수:
string $assoc_s Association as serialized by serialize()
반환값:
Auth_OpenID_Association $result instance of this class

Association.php 파일의 198 번째 라인에서 정의되었습니다.

다음을 참조함 : null, Auth_OpenID_KVForm::toArray().

다음에 의해서 참조됨 : Auth_OpenID_FileStore::_getAssociation(), Auth_OpenID_FileStore::clean().

00199     {
00200         $pairs = Auth_OpenID_KVForm::toArray($assoc_s, $strict = true);
00201         $keys = array();
00202         $values = array();
00203         foreach ($pairs as $key => $value) {
00204             if (is_array($value)) {
00205                 list($key, $value) = $value;
00206             }
00207             $keys[] = $key;
00208             $values[] = $value;
00209         }
00210 
00211         $class_vars = get_class_vars($class_name);
00212         $class_assoc_keys = $class_vars['assoc_keys'];
00213 
00214         sort($keys);
00215         sort($class_assoc_keys);
00216 
00217         if ($keys != $class_assoc_keys) {
00218             trigger_error('Unexpected key values: ' . strval($keys),
00219                           E_USER_WARNING);
00220             return null;
00221         }
00222 
00223         $version = $pairs['version'];
00224         $handle = $pairs['handle'];
00225         $secret = $pairs['secret'];
00226         $issued = $pairs['issued'];
00227         $lifetime = $pairs['lifetime'];
00228         $assoc_type = $pairs['assoc_type'];
00229 
00230         if ($version != '2') {
00231             trigger_error('Unknown version: ' . $version, E_USER_WARNING);
00232             return null;
00233         }
00234 
00235         $issued = intval($issued);
00236         $lifetime = intval($lifetime);
00237         $secret = base64_decode($secret);
00238 
00239         return new $class_name(
00240             $handle, $secret, $issued, $lifetime, $assoc_type);
00241     }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

Auth_OpenID_Association::equal ( other  ) 

This checks to see if two Auth_OpenID_Association instances represent the same association.

반환값:
bool $result true if the two instances represent the same association, false otherwise.

Association.php 파일의 159 번째 라인에서 정의되었습니다.

00160     {
00161         return ((gettype($this) == gettype($other))
00162                 && ($this->handle == $other->handle)
00163                 && ($this->secret == $other->secret)
00164                 && ($this->issued == $other->issued)
00165                 && ($this->lifetime == $other->lifetime)
00166                 && ($this->assoc_type == $other->assoc_type));
00167     }

Auth_OpenID_Association::fromExpiresIn ( expires_in,
handle,
secret,
assoc_type 
)

This is an alternate constructor (factory method) used by the OpenID consumer library to create associations. OpenID store implementations shouldn't use this constructor.

private

매개변수:
integer $expires_in This is the amount of time this association is good for, measured in seconds since the association was issued.
string $handle This is the handle the server gave this association.
string secret This is the shared secret the server generated for this association.
assoc_type This is the type of association this instance represents. The only valid value of this field at this time is 'HMAC-SHA1', but new types may be defined in the future.
반환값:
association An Auth_OpenID_Association instance.

Association.php 파일의 87 번째 라인에서 정의되었습니다.

다음을 참조함 : Auth_OpenID_Association().

다음에 의해서 참조됨 : Auth_OpenID_GenericConsumer::_parseAssociation(), Auth_OpenID_Signatory::createAssociation().

00088     {
00089         $issued = time();
00090         $lifetime = $expires_in;
00091         return new Auth_OpenID_Association($handle, $secret,
00092                                            $issued, $lifetime, $assoc_type);
00093     }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

Auth_OpenID_Association::getExpiresIn ( now = null  ) 

This returns the number of seconds this association is still valid for, or 0 if the association is no longer valid.

반환값:
integer $seconds The number of seconds this association is still valid for, or 0 if the association is no longer valid.

Association.php 파일의 143 번째 라인에서 정의되었습니다.

다음을 참조함 : null.

00144     {
00145         if ($now == null) {
00146             $now = time();
00147         }
00148 
00149         return max(0, $this->issued + $this->lifetime - $now);
00150     }

Auth_OpenID_Association::serialize (  ) 

Convert an association to KV form.

반환값:
string $result String in KV form suitable for deserialization by deserialize.

Association.php 파일의 175 번째 라인에서 정의되었습니다.

다음을 참조함 : Auth_OpenID_KVForm::fromArray().

00176     {
00177         $data = array(
00178                      'version' => '2',
00179                      'handle' => $this->handle,
00180                      'secret' => base64_encode($this->secret),
00181                      'issued' => strval(intval($this->issued)),
00182                      'lifetime' => strval(intval($this->lifetime)),
00183                      'assoc_type' => $this->assoc_type
00184                      );
00185 
00186         assert(array_keys($data) == $this->assoc_keys);
00187 
00188         return Auth_OpenID_KVForm::fromArray($data, $strict = true);
00189     }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

Auth_OpenID_Association::sign ( pairs  ) 

Generate a signature for a sequence of (key, value) pairs

private

매개변수:
array $pairs The pairs to sign, in order. This is an array of two-tuples.
반환값:
string $signature The binary signature of this sequence of pairs

Association.php 파일의 252 번째 라인에서 정의되었습니다.

다음을 참조함 : Auth_OpenID_KVForm::fromArray().

다음에 의해서 참조됨 : signDict().

00253     {
00254         $kv = Auth_OpenID_KVForm::fromArray($pairs);
00255         return Auth_OpenID_HMACSHA1($this->secret, $kv);
00256     }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

Auth_OpenID_Association::signDict ( fields,
data,
prefix = 'openid.' 
)

Generate a signature for some fields in a dictionary

private

매개변수:
array $fields The fields to sign, in order; this is an array of strings.
array $data Dictionary of values to sign (an array of string => string pairs).
반환값:
string $signature The signature, base64 encoded

Association.php 파일의 268 번째 라인에서 정의되었습니다.

다음을 참조함 : sign().

다음에 의해서 참조됨 : addSignature(), checkSignature().

00269     {
00270         $pairs = array();
00271         foreach ($fields as $field) {
00272             $pairs[] = array($field, $data[$prefix . $field]);
00273         }
00274 
00275         return base64_encode($this->sign($pairs));
00276     }

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:


멤버 데이타 문서화

Auth_OpenID_Association::$assoc_keys
초기값:
 array(
                            'version',
                            'handle',
                            'secret',
                            'issued',
                            'lifetime',
                            'assoc_type'
                            )

The ordering and name of keys as stored by serialize.

private

Association.php 파일의 53 번째 라인에서 정의되었습니다.

Auth_OpenID_Association::$SIG_LENGTH = 20

This is a HMAC-SHA1 specific value.

private

Association.php 파일의 46 번째 라인에서 정의되었습니다.


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.:

생성시간 : Wed Oct 28 22:59:44 2009, 프로젝트명 : XpressEngine, 생성자 :   doxygen 1.6.1