/** * @dataProvider isEncryptedSymmetricallyProvider */ public function testIsEncryptedSymmetrically($expected, $data) { $msg = Horde_Pgp_Element_Message::create($data); if ($expected) { $this->assertTrue($msg->isEncryptedSymmetrically()); } else { $this->assertFalse($msg->isEncryptedSymmetrically()); } }
/** * Decrypts text using a PGP symmetric passphrase. * * @param mixed $text The text to be decrypted. * @param string $passphrase The symmetric passphrase used to encrypt * the data. * * @return array $data Array of decrypted data. Outer array indicates a * message block. Each entry is an array with two * array elements: a list of data packets contained * in that message block and a list of signature data * associated with that block. * @throws Horde_Pgp_Exception */ public function decryptSymmetric($text, $passphrase) { return $this->_runInBackend('decryptSymmetric', array(Horde_Pgp_Element_Message::create($text), $passphrase), Horde_Pgp_Translation::t("Could not decrypt PGP data.")); }