PHP Class Auth_OpenID_Association

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.
Afficher le fichier Open project: openid/php-openid Class Usage Examples

Méthodes publiques

Свойство Type Description
$SIG_LENGTH This is a HMAC-SHA1 specific value.
$_macs
$assoc_keys The ordering and name of keys as stored by serialize.

Méthodes publiques

Méthode Description
__construct ( string $handle, string $secret, integer $issued, integer $lifetime, string $assoc_type ) This is the standard constructor for creating an association.
_makePairs ( $message ) Given a {@link 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.
checkMessageSignature ( $message ) Confirm that the signature of these fields matches the signature contained in the data.
deserialize ( $class_name, string $assoc_s ) : Auth_OpenID_Association Parse an association as stored by serialize(). This is the inverse of serialize.
equal ( $other ) : boolean This checks to see if two {@link Auth_OpenID_Association} instances represent the same association.
fromExpiresIn ( integer $expires_in, string $handle, $secret, $assoc_type ) : association This is an alternate constructor (factory method) used by the OpenID consumer library to create associations. OpenID store implementations shouldn't use this constructor.
getExpiresIn ( $now = null ) : integer This returns the number of seconds this association is still valid for, or 0 if the association is no longer valid.
getMessageSignature ( $message ) Given an {@link Auth_OpenID_Message}, return the signature for the signed list in the message.
serialize ( ) : string Convert an association to KV form.
sign ( array $pairs ) : string Generate a signature for a sequence of (key, value) pairs
signMessage ( $message ) : string Generate a signature for some fields in a dictionary

Method Details

__construct() public méthode

The library should create all of the necessary associations, so this constructor is not part of the external API.
public __construct ( string $handle, string $secret, integer $issued, integer $lifetime, string $assoc_type )
$handle string This is the handle the server gave this association.
$secret string This is the shared secret the server generated for this association.
$issued integer This is the time this association was issued, in seconds since 00:00 GMT, January 1, 1970. (ie, a unix timestamp)
$lifetime integer This is the amount of time this association is good for, measured in seconds since the association was issued.
$assoc_type string 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.

_makePairs() public méthode

Given a {@link 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.
public _makePairs ( $message )

checkMessageSignature() public méthode

Confirm that the signature of these fields matches the signature contained in the data.
public checkMessageSignature ( $message )

deserialize() static public méthode

Parse an association as stored by serialize(). This is the inverse of serialize.
static public deserialize ( $class_name, string $assoc_s ) : Auth_OpenID_Association
$assoc_s string Association as serialized by serialize()
Résultat Auth_OpenID_Association $result instance of this class

equal() public méthode

This checks to see if two {@link Auth_OpenID_Association} instances represent the same association.
public equal ( $other ) : boolean
Résultat boolean $result true if the two instances represent the same association, false otherwise.

fromExpiresIn() static public méthode

This is an alternate constructor (factory method) used by the OpenID consumer library to create associations. OpenID store implementations shouldn't use this constructor.
static public fromExpiresIn ( integer $expires_in, string $handle, $secret, $assoc_type ) : association
$expires_in integer This is the amount of time this association is good for, measured in seconds since the association was issued.
$handle string This is the handle the server gave this association.
Résultat association An {@link Auth_OpenID_Association} instance.

getExpiresIn() public méthode

This returns the number of seconds this association is still valid for, or 0 if the association is no longer valid.
public getExpiresIn ( $now = null ) : integer
Résultat integer $seconds The number of seconds this association is still valid for, or 0 if the association is no longer valid.

getMessageSignature() public méthode

Given an {@link Auth_OpenID_Message}, return the signature for the signed list in the message.
public getMessageSignature ( $message )

serialize() public méthode

Convert an association to KV form.
public serialize ( ) : string
Résultat string $result String in KV form suitable for deserialization by deserialize.

sign() public méthode

Generate a signature for a sequence of (key, value) pairs
public sign ( array $pairs ) : string
$pairs array The pairs to sign, in order. This is an array of two-tuples.
Résultat string $signature The binary signature of this sequence of pairs

signMessage() public méthode

Generate a signature for some fields in a dictionary
public signMessage ( $message ) : string
Résultat string $signature The signature, base64 encoded

Property Details

$SIG_LENGTH public_oe property

This is a HMAC-SHA1 specific value.
public $SIG_LENGTH

$_macs public_oe property

public $_macs

$assoc_keys public_oe property

The ordering and name of keys as stored by serialize.
public $assoc_keys