예제 #1
0
 public function testGenerateSignature()
 {
     $signatureMethod = new HmacSha1();
     $baseString = 'test_base_string';
     $key = 'test_key';
     $signature = $signatureMethod->generateSignature($baseString, $key);
     $this->assertNotEmpty($signature, 'Unable to generate signature!');
 }
예제 #2
0
 /**
  * Creates signature method instance from its configuration.
  * @param array $signatureMethodConfig signature method configuration.
  * @return signature\BaseMethod signature method instance.
  */
 protected function createSignatureMethod(array $signatureMethodConfig)
 {
     if (!array_key_exists('class', $signatureMethodConfig)) {
         $signatureMethodConfig['class'] = signature\HmacSha1::className();
     }
     return Yii::createObject($signatureMethodConfig);
 }