Auth_OpenID_Association Class Reference

List of all members.


Detailed Description

This module contains code for dealing with associations between consumers and servers.

PHP versions 4 and 5

LICENSE: See the COPYING file included in this distribution.

Author:
JanRain, Inc. <[email protected]> 2005-2008 Janrain, Inc. http://www.apache.org/licenses/LICENSE-2.0 Apache private private private This class represents an association between a server and a consumer. In general, users of this library will never see instances of this object. The only exception is if you implement a custom Auth_OpenID_OpenIDStore.
If you do implement such a store, it will need to store the values of the handle, secret, issued, lifetime, and assoc_type instance variables.

Definition at line 44 of file Association.php.


Public Member Functions

 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)
 signMessage ($message)
 _makePairs (&$message)
 getMessageSignature (&$message)
 checkMessageSignature (&$message)

Public Attributes

 $SIG_LENGTH = 20
 $assoc_keys
 $_macs

Member Function Documentation

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

Parameters:
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 values of this field at this time is 'HMAC-SHA1' and 'HMAC-SHA256', but new types may be defined in the future.
Returns:
association An Auth_OpenID_Association instance.

Definition at line 97 of file Association.php.

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

Parameters:
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 values of this field at this time is 'HMAC-SHA1' and 'HMAC-SHA256', but new types may be defined in the future.

Definition at line 131 of file Association.php.

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.

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

Definition at line 154 of file Association.php.

Auth_OpenID_Association.equal ( other  ) 

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

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

Definition at line 170 of file Association.php.

Auth_OpenID_Association.serialize (  ) 

Convert an association to KV form.

Returns:
string $result String in KV form suitable for deserialization by deserialize.

Definition at line 186 of file Association.php.

Auth_OpenID_Association.deserialize ( class_name,
assoc_s 
)

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

Parameters:
string $assoc_s Association as serialized by serialize()
Returns:
Auth_OpenID_Association $result instance of this class

Definition at line 209 of file Association.php.

Auth_OpenID_Association.sign ( pairs  ) 

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

private

Parameters:
array $pairs The pairs to sign, in order. This is an array of two-tuples.
Returns:
string $signature The binary signature of this sequence of pairs

Definition at line 263 of file Association.php.

Auth_OpenID_Association.signMessage ( message  ) 

Generate a signature for some fields in a dictionary

private

Parameters:
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).
Returns:
string $signature The signature, base64 encoded

Definition at line 283 of file Association.php.

Auth_OpenID_Association._makePairs ( &$  message  ) 

Given a Auth_OpenID_Message, return the key/value pairs to be signed according to the signed list in the message. If the message lacks a signed list, return null.

private

Definition at line 330 of file Association.php.

Auth_OpenID_Association.getMessageSignature ( &$  message  ) 

Given an Auth_OpenID_Message, return the signature for the signed list in the message.

private

Definition at line 355 of file Association.php.

Auth_OpenID_Association.checkMessageSignature ( &$  message  ) 

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

private

Definition at line 367 of file Association.php.


Member Data Documentation

Auth_OpenID_Association.$SIG_LENGTH = 20

This is a HMAC-SHA1 specific value.

private

Definition at line 51 of file Association.php.

Auth_OpenID_Association.$assoc_keys

Initial value:

 array(
                            'version',
                            'handle',
                            'secret',
                            'issued',
                            'lifetime',
                            'assoc_type'
                            )
The ordering and name of keys as stored by serialize.

private

Definition at line 58 of file Association.php.

Auth_OpenID_Association.$_macs

Initial value:

 array(
                       'HMAC-SHA1' => 'Auth_OpenID_HMACSHA1',
                       'HMAC-SHA256' => 'Auth_OpenID_HMACSHA256'
                       )

Definition at line 67 of file Association.php.


The documentation for this class was generated from the following file:

Generated on Thu Feb 19 15:02:47 2009 for OXID eShop CE by  doxygen 1.5.5