You are here

abstract class sOAuthSignatureMethod in jQuery social stream 7

Same name and namespace in other branches
  1. 7.2 jquery_social_stream.js.inc \sOAuthSignatureMethod

A class for implementing a Signature Method See section 9 ("Signing Requests") in the spec

Hierarchy

Expanded class hierarchy of sOAuthSignatureMethod

File

./jquery_social_stream.js.inc, line 384
JS callbacks.

View source
abstract class sOAuthSignatureMethod {

  /**
   * Needs to return the name of the Signature Method (ie HMAC-SHA1)
   * @return string
   */
  public abstract function get_name();

  /**
   * Build up the signature
   * NOTE: The output of this function MUST NOT be urlencoded.
   * the encoding is handled in sOAuthRequest when the final
   * request is serialized
   * @param sOAuthRequest $request
   * @param sOAuthConsumer $consumer
   * @param sOAuthToken $token
   * @return string
   */
  public abstract function build_signature($request, $consumer, $token);

  /**
   * Verifies that a given signature is correct
   * @param sOAuthRequest $request
   * @param sOAuthConsumer $consumer
   * @param sOAuthToken $token
   * @param string $signature
   * @return bool
   */
  public function check_signature($request, $consumer, $token, $signature) {
    $built = $this
      ->build_signature($request, $consumer, $token);
    return $built == $signature;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
sOAuthSignatureMethod::build_signature abstract public function Build up the signature NOTE: The output of this function MUST NOT be urlencoded. the encoding is handled in sOAuthRequest when the final request is serialized 3
sOAuthSignatureMethod::check_signature public function Verifies that a given signature is correct 1
sOAuthSignatureMethod::get_name abstract public function Needs to return the name of the Signature Method (ie HMAC-SHA1) 3