/** * TODO */ protected function _getPrivateKey($key) { $key = Horde_Pgp_Element_PrivateKey::create($key); if ($key->encrypted) { throw new InvalidArgumentException('Private key must be decrypted.'); } return $key; }
protected function _initData() { $this->part = new Horde_Mime_Part(); $this->part->setType('text/plain'); $this->part->setContents('Foo Bar.'); $this->key = Horde_Pgp_Element_PrivateKey::create(file_get_contents(__DIR__ . '/fixtures/pgp_private_rsa.txt'))->getUnencryptedKey('Secret'); }
protected function _getPrivateKey($file, $pass = null) { $pkey = Horde_Pgp_Element_PrivateKey::create($this->_getFixture($file)); return is_null($pass) ? $pkey : $pkey->getUnencryptedKey($pass); }