예제 #1
0
 /**
  * Factory build method for signature 
  *
  * @param Request $request
  * @param array $options
  */
 public function build($request, $options = array())
 {
     $_this = Signature::getInstance();
     $request = RequestFactory::proxy($request, $options);
     $signatureMethod = $request->signatureMethod();
     if (isset($_this->availableMethods[$signatureMethod])) {
         $class = $_this->availableMethods[$signatureMethod];
     } else {
         throw new Exception("UnknownSignatureMethod {$signatureMethod}");
     }
     return new $class($request, $options);
 }
예제 #2
0
 /**
  * testThatHmacSha1ImplementsRsaSha1
  *
  * @return void
  */
 public function testThatHmacSha1ImplementsRsaSha1()
 {
     $sig = Signature::getInstance();
     $this->assertTrue(isset($sig->availableMethods['RSA-SHA1']));
 }