/** * 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; }
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); }