Пример #1
0
Файл: RSA.php Проект: stunti/zf2
 /**
  * Sign a request
  * 
  * @param  array $params 
  * @param  null|string $method 
  * @param  null|string $url 
  * @return string
  */
 public function sign(array $params, $method = null, $url = null)
 {
     $rsa = new RSAEncryption();
     $rsa->setHashAlgorithm($this->_hashAlgorithm);
     $sign = $rsa->sign($this->_getBaseSignatureString($params, $method, $url), $this->_key, RSAEncryption::BASE64);
     return $sign;
 }
Пример #2
0
 public function testVerifyVerifiesBase64Signatures()
 {
     $rsa = new RSA(array('pemString' => $this->_testPemString));
     $signature = $rsa->sign('1234567890', null, RSA::BASE64);
     $result = $rsa->verifySignature('1234567890', $signature, RSA::BASE64);
     $this->assertEquals(1, $result);
 }