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() |
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.
Association.php 파일의 159 번째 라인에서 정의되었습니다.
| 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.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.
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.
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. |
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). |
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 |
1.6.1