public function testEncryptionUsingPrivateKeyBase64Encryption() { $encrypted = $this->rsaBase64Out->encrypt('1234567890', $this->rsaBase64Out->getOptions()->getPrivateKey()); $decrypted = $this->rsaBase64Out->decrypt(base64_decode($encrypted), $this->rsaBase64Out->getOptions()->getPublicKey()); $this->assertEquals('1234567890', $decrypted); }
public function testEncryptionUsingPrivateKeyBase64Encryption() { $rsa = new Rsa(new RsaOptions(array('pem_string' => $this->_testPemString))); $encrypted = $rsa->encrypt('1234567890', $rsa->getOptions()->getPrivateKey(), Rsa::FORMAT_BASE64); $this->assertEquals( '1234567890', $rsa->decrypt($encrypted, $rsa->getOptions()->getPublicKey(), Rsa::FORMAT_BASE64) ); }
/** * {@inheritdoc} */ public function encrypt($value) { return $this->zendRsa->encrypt($value); }