File: OAuthSignatureMethodRSASHA1.php

package info (click to toggle)
simplesamlphp 1.13.1-2%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 11,304 kB
  • sloc: php: 65,124; xml: 629; python: 376; sh: 193; perl: 185; makefile: 43
file content (32 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

require_once(dirname(dirname(__FILE__)) . '/libextinc/OAuth.php');


class sspmod_oauth_OAuthSignatureMethodRSASHA1 extends OAuthSignatureMethod_RSA_SHA1 {
	protected $_store;
	
	public function __construct() {
		$this->_store = new sspmod_core_Storage_SQLPermanentStorage('oauth');
	}
	
	/**
	 * Returns the secret that was registered with a Consumer<br/>
	 * In case of RSA_SHA1, the consumer secret is initialized with the certificate containing the public key
	 * @param $request OAuthRequest instance of the request to be handled; must contain oauth_consumer_key parameter
	 * @return string value containing the public key that was registered with the consumer identified by 
	 * 			consumer_key from the request 
	 */
	protected function fetch_public_cert(&$request) {
		$consumer_key = @$request->get_parameter('oauth_consumer_key');
		
		$oConsumer = $this->_OAuthStore->lookup_consumer($consumer_key);
		
		if (! $oConsumer) {
			return NULL;
		}
		
		return $oConsumer->secret;
	}
}
?>