예제 #1
0
파일: HMACTest.php 프로젝트: stunti/zf2
 public function testHmacRIPEMD160_7()
 {
     $data = 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data';
     $key = str_repeat("ª", 80);
     $hmac = HMAC::compute($key, 'RIPEMD160', $data);
     $this->assertEquals('69ea60798d71616cce5fd0871e23754cd75d5a0a', $hmac);
 }
예제 #2
0
파일: HMAC.php 프로젝트: stunti/zf2
 /**
  * Sign a request
  * 
  * @param  array $params 
  * @param  mixed $method 
  * @param  mixed $url 
  * @return string
  */
 public function sign(array $params, $method = null, $url = null)
 {
     $binaryHash = HMACEncryption::compute($this->_key, $this->_hashAlgorithm, $this->_getBaseSignatureString($params, $method, $url), HMACEncryption::BINARY);
     return base64_encode($binaryHash);
 }