Class OpenID_Association

Description

OpenID_Association

A class that represents an association. This class can be serialized for storage. It also allows you to add and check signatures of an OpenID_Message.

Located in /OpenID/Association.php (line 37)


	
			
Variable Summary
string $assocHandle
string $assocType
int $created
mixed $expiresIn
string $uri
Method Summary
void __construct ( $params)
string getAlgorithm ()
string hashHMAC (OpenID_Message $message)
void signMessage (OpenID_Message $message)
mixed __get (string $name)
Variables
string $assocHandle = null (line 73)

assoc_handle parameter of the association.

  • access: protected
string $assocType = null (line 66)

assoc_type parameter of the association. Should be one of HMAC-SHA1 or HMAC-SHA256

  • access: protected
int $created = null (line 58)

Unix timestamp of when this association was created.

  • access: protected
mixed $expiresIn = null (line 51)

expires_in paramater of the association. Time is in seconds.

  • access: protected
array $requiredParams = array(
'uri',
'expiresIn',
'created',
'assocType',
'assocHandle',
'sharedSecret'
)
(line 89)

Required parameters for storing an association.

mixed $sharedSecret = null (line 81)

In the association response, this is also referred to as the "mac_key", or is derived from the "enc_mac_key" if the session used encryption.

  • access: protected
array $supportedTypes = array(
OpenID::ASSOC_TYPE_HMAC_SHA1,
OpenID::ASSOC_TYPE_HMAC_SHA256
)
(line 105)

Local list of supported association types.

string $uri = null (line 44)

URI of the OP Endpoint

  • access: protected
Methods
Constructor __construct (line 119)

Validates some association values before setting them as member variables.

  • throws: OpenID_Association_Exception if the response is not valid
  • access: public
void __construct ( $params)
  • array $params: Array of relevant parameters from the association response
checkMessageSignature (line 181)

Checks the signature of an OpenID_Message using this association

  • return: true if the signatures match, false otherwise
  • throws: OpenID_Association_Exception if the handles don't match
  • access: public
bool checkMessageSignature (OpenID_Message $message)
getAlgorithm (line 168)

Gets the algo part of the assoc_type (strips 'HMAC-')

  • return: Algorithm part of the assoc_type handle
  • access: public
string getAlgorithm ()
getMessageForSigning (line 235)

Returns a KV formatted message for signing based on the contents of the openid.signed key. This allows for duplicate entries, which OpenID_Message::getKVFormat() doesn't. (Yahoo! uses duplicates)

  • return: The openid.signed items in KV form
  • access: public
string getMessageForSigning (OpenID_Message $message)
  • OpenID_Message $message: An instance of the OpenID_Message you want to sign
hashHMAC (line 299)

Gets a an HMAC hash of an OpenID_Message using this association.

  • return: The HMAC hash
  • access: protected
string hashHMAC (OpenID_Message $message)
signMessage (line 255)

Signs an OpenID_Message instance

  • throws: OpenID_Association_Exception if the message is already signed,
  • access: public
void signMessage (OpenID_Message $message)
__get (line 158)

Allows access to association data via $assoc->name

  • return: Value
  • access: public
mixed __get (string $name)
  • string $name: Name of the item to get

Documentation generated on Tue, 15 Dec 2009 19:00:51 -0800 by phpDocumentor 1.4.3