OpenID
[ class tree: OpenID ] [ index: OpenID ] [ all elements ]

Class: OpenID_Association

Source Location: /OpenID-0.4.0/OpenID/Association.php

Class Overview


OpenID_Association


Author(s):

Copyright:

  • 2009 Bill Shupp

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 36]
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.



[ Top ]


Class Variables

$assocHandle =  null

[line 72]

assoc_handle parameter of the association.
  • Access: protected

Type:   string


[ Top ]

$assocType =  null

[line 65]

assoc_type parameter of the association. Should be one of HMAC-SHA1 or HMAC-SHA256
  • Access: protected

Type:   string


[ Top ]

$created =  null

[line 57]

Unix timestamp of when this association was created.
  • Access: protected

Type:   int


[ Top ]

$expiresIn =  null

[line 50]

expires_in paramater of the association. Time is in seconds.
  • Access: protected

Type:   mixed


[ Top ]

$requiredParams = array(
        'uri',
        'expiresIn',
        'created',
        'assocType',
        'assocHandle',
        'sharedSecret'
    )

[line 88]

Required parameters for storing an association.

Type:   array


[ Top ]

$sharedSecret =  null

[line 80]

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

Type:   mixed


[ Top ]

$supportedTypes = array(
        OpenID::ASSOC_TYPE_HMAC_SHA1,
        OpenID::ASSOC_TYPE_HMAC_SHA256
    )

[line 104]

Local list of supported association types.

Type:   array


[ Top ]

$uri =  null

[line 43]

URI of the OP Endpoint
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 118]

void __construct( array $params)

Validates some association values before setting them as member variables.
  • Throws: OpenID_Association_Exception if the response is not valid
  • Access: public

Parameters:

array   $params   —  Array of relevant parameters from the association response

[ Top ]

checkMessageSignature   [line 183]

bool checkMessageSignature( OpenID_Message $message)

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

Parameters:

OpenID_Message   $message   —  Instance of OpenID_Message

[ Top ]

getAlgorithm   [line 170]

string getAlgorithm( )

Gets the algo part of the assoc_type (strips 'HMAC-')
  • Return: Algorithm part of the assoc_type handle
  • Access: public

[ Top ]

getMessageForSigning   [line 239]

string getMessageForSigning( OpenID_Message $message)

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

Parameters:

OpenID_Message   $message   —  An instance of the OpenID_Message you want to sign

[ Top ]

hashHMAC   [line 305]

string hashHMAC( OpenID_Message $message)

Gets a an HMAC hash of an OpenID_Message using this association.
  • Return: The HMAC hash
  • Access: protected

Parameters:

OpenID_Message   $message   —  The message format of the items to hash

[ Top ]

signMessage   [line 259]

void signMessage( OpenID_Message $message)

Signs an OpenID_Message instance
  • Throws: OpenID_Association_Exception if the message is already signed,
  • Access: public

Parameters:

OpenID_Message   $message   —  Message to be signed

[ Top ]

__get   [line 160]

mixed __get( string $name)

Allows access to association data via $assoc->name
  • Return: Value
  • Access: public

Parameters:

string   $name   —  Name of the item to get

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:57:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.