PHP Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$SIG_LENGTH This is a HMAC-SHA1 specific value.
$_macs
$assoc_keys The ordering and name of keys as stored by serialize.

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

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() публичный Метод

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() публичный Метод

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

deserialize() статический публичный Метод

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()
Результат Auth_OpenID_Association $result instance of this class

equal() публичный Метод

This checks to see if two {@link Auth_OpenID_Association} instances represent the same association.
public equal ( $other ) : boolean
Результат boolean $result true if the two instances represent the same association, false otherwise.

fromExpiresIn() статический публичный Метод

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.
Результат association An {@link Auth_OpenID_Association} instance.

getExpiresIn() публичный Метод

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
Результат integer $seconds The number of seconds this association is still valid for, or 0 if the association is no longer valid.

getMessageSignature() публичный Метод

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

serialize() публичный Метод

Convert an association to KV form.
public serialize ( ) : string
Результат string $result String in KV form suitable for deserialization by deserialize.

sign() публичный Метод

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.
Результат string $signature The binary signature of this sequence of pairs

signMessage() публичный Метод

Generate a signature for some fields in a dictionary
public signMessage ( $message ) : string
Результат string $signature The signature, base64 encoded

Описание свойств

$SIG_LENGTH публичное свойство

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

$_macs публичное свойство

public $_macs

$assoc_keys публичное свойство

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