You are here

public function OAuthSignatureMethod_RSA_SHA1::build_signature in OAuth 1.0 6

Same name and namespace in other branches
  1. 6.3 lib/OAuth.php \OAuthSignatureMethod_RSA_SHA1::build_signature()
  2. 7.3 lib/OAuth.php \OAuthSignatureMethod_RSA_SHA1::build_signature()

File

./OAuth.php, line 124

Class

OAuthSignatureMethod_RSA_SHA1

Code

public function build_signature(&$request, $consumer, $token) {

  /*{{{*/
  $base_string = $request
    ->get_signature_base_string();

  // Fetch the private key cert based on the request
  $cert = $this
    ->fetch_private_cert($request);

  //Pull the private key ID from the certificate
  $privatekeyid = openssl_get_privatekey($cert);

  //Check the computer signature against the one passed in the query
  $ok = openssl_sign($base_string, $signature, $privatekeyid);

  //Release the key resource
  openssl_free_key($privatekeyid);
  return base64_encode($signature);
}