You are here

public function LingotekOAuthRequestVerifier::verifyDataSignature in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.7 lib/oauth-php/library/LingotekOAuthRequestVerifier.php \LingotekOAuthRequestVerifier::verifyDataSignature()
  2. 7.5 lib/oauth-php/library/LingotekOAuthRequestVerifier.php \LingotekOAuthRequestVerifier::verifyDataSignature()
  3. 7.6 lib/oauth-php/library/LingotekOAuthRequestVerifier.php \LingotekOAuthRequestVerifier::verifyDataSignature()

* Verify the signature of a string. * *

Parameters

string data: * @param string consumer_secret * @param string token_secret * @param string signature_method * @param string signature * @exception OAuthException2 thrown when the signature method is unknown * @exception OAuthException2 when signature does not match

2 calls to LingotekOAuthRequestVerifier::verifyDataSignature()
LingotekOAuthRequestVerifier::verifyExtended in lib/oauth-php/library/LingotekOAuthRequestVerifier.php
* Verify the request * *
LingotekOAuthRequestVerifier::verifySignature in lib/oauth-php/library/LingotekOAuthRequestVerifier.php
* Verify the signature of the request, using the method in oauth_signature_method. * The signature is returned encoded in the form as used in the url. So the base64 and * urlencoding has been done. * *

File

lib/oauth-php/library/LingotekOAuthRequestVerifier.php, line 275

Class

LingotekOAuthRequestVerifier

Code

public function verifyDataSignature($data, $consumer_secret, $token_secret, $signature_method, $signature) {
  if (is_null($data)) {
    $data = '';
  }
  $sig = $this
    ->getSignatureMethod($signature_method);
  if (!$sig
    ->verify($this, $data, $consumer_secret, $token_secret, $signature)) {
    throw new OAuthException2('Signature verification failed (' . $signature_method . ')');
  }
}