| Methods |
public
|
__construct(int $mode = self::ASSOCIATION_SHARED, string $assoc_type = 'HMAC-SHA1')
Creates an association for OpenID versions 1 and 2.
Creates an association for OpenID versions 1 and 2.
This function calls DiffieHellman::associateAsServer() where required, to
generate the cryptographic values required for an association response.
Parameters
| $mode |
either ASSOCIATION_SHARED or ASSOCIATION_PRIVATE
|
| $assoc_type |
a valid OpenID association type
|
|
#
|
public
|
getHandle(): string
Returns the association handle.
Returns the association handle.
Returns
|
#
|
public
|
getCreationTime(): int
Returns the creation time.
Returns the creation time.
Returns
|
#
|
public
|
isPrivate(): bool
Returns whether this is a private association.
Returns whether this is a private association.
Returns
true if this is a private association
|
#
|
public
|
getOpenIDResponse(
string $session_type = 'no-encryption',
string $dh_consumer_public = null,
string $dh_modulus = null,
string $dh_gen = null,
): array<string, string>
Creates data an OpenID association response.
Creates data an OpenID association response.
This function calls SimpleID\Protocols\OpenID\DiffieHellman::assciateAsServer()
where required, to
generate the cryptographic values required for an association response.
Parameters
| $session_type |
a valid OpenID session type
|
| $dh_consumer_public |
for Diffie-Hellman key exchange, the public key of the relying party encoded in Base64
|
| $dh_modulus |
for Diffie-Hellman key exchange, the modulus encoded in Base64
|
| $dh_gen |
for Diffie-Hellman key exchange, g encoded in Base64
|
Returns
data that can be fed into an OpenID association response
|
#
|
public
|
sign(Message $message): string
Calculates a signature of an OpenID message
Calculates a signature of an OpenID message
Parameters
| $message |
the message to sign
|
Returns
the signature encoded in Base64
|
#
|
public
|
toString(): string
Returns a string representation of the association for debugging purposes
Returns a string representation of the association for debugging purposes
Returns
a string representation of the association
|
#
|
public
static
|
getAssociationTypes(): array<string, mixed>
Returns the association types supported by this server.
Returns the association types supported by this server.
Returns
an array containing the association types supported by this server as keys
and an array containing the key size (mac_size) and HMAC algorithm (algo) as
values
|
#
|
public
static
|
getSessionTypes(bool $is_https = true, float $version = Message::OPENID_VERSION_2): array<string, mixed>
Returns the association types supported by this server and the version of
OpenID.
Returns the association types supported by this server and the version of
OpenID.
OpenID version 1 supports an empty string as the session type. OpenID version 2
reqires a session type to be sent.
Parameters
| $is_https |
whether the transport layer encryption is used for the current
connection
|
| $version |
the OpenID version, either OPENID_VERSION_1_1 and OPENID_VERSION_2
|
Returns
an array containing the session types supported by this server as keys
and an array containing the hash function (hash_func) as
values
|
#
|