Modules

abstract OAuth_Signature
extends Kohana_OAuth_Signature

OAuth Signature

package
Kohana/OAuth
category
Signature
author
Kohana Team
copyright
© 2010 Kohana Team
license
http://kohanaframework.org/license
since
3.0.7

Class declared in MODPATH/oauth/classes/oauth/signature.php on line 3.

Constants

  • None

Properties

Properties

protected string $name

signature name: HMAC-SHA1, PLAINTEXT, etc

Methods

public __get( string $key ) (defined in Kohana_OAuth_Signature)

Return the value of any protected class variables.

$name = $signature->name;

Parameters

  • string $key required - Variable name

Return Values

  • mixed

Source Code

public function __get($key)
{
	return $this->$key;
}

public static factory( string $name [, array $options = NULL ] ) (defined in Kohana_OAuth_Signature)

Create a new signature object by name.

$signature = OAuth_Signature::factory('HMAC-SHA1');

Parameters

  • string $name required - Signature name: HMAC-SHA1, PLAINTEXT, etc
  • array $options = NULL - Signature options

Return Values

  • OAuth_Signature

Source Code

public static function factory($name, array $options = NULL)
{
	// Create the class name as a base of this class
	$class = 'OAuth_Signature_'.str_replace('-', '_', $name);

	return new $class($options);
}

public key( OAuth_Consumer $consumer [, OAuth_Token $token = NULL ] ) (defined in Kohana_OAuth_Signature)

Get a signing key from a consumer and token.

$key = $signature->key($consumer, $token);

This method implements the signing key of OAuth 1.0 Spec 9.

Parameters

  • OAuth_Consumer $consumer required - Consumer
  • OAuth_Token $token = NULL - Token

Tags

Return Values

  • string

Source Code

public function key(OAuth_Consumer $consumer, OAuth_Token $token = NULL)
{
	$key = OAuth::urlencode($consumer->secret).'&';

	if ($token)
	{
		$key .= OAuth::urlencode($token->secret);
	}

	return $key;
}

abstract public sign( ) (defined in Kohana_OAuth_Signature)

Source Code

abstract public function sign(OAuth_Request $request, OAuth_Consumer $consumer, OAuth_Token $token = NULL);

abstract public verify( ) (defined in Kohana_OAuth_Signature)

Source Code

abstract public function verify($signature, OAuth_Request $request, OAuth_Consumer $consumer, OAuth_Token $token = NULL);