Author: Michael Slusarz (slusarz@horde.org)
Inheritance: extends Horde_Pgp_Element_Key
Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
 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');
 }
Esempio n. 3
0
 protected function _getPrivateKey($file, $pass = null)
 {
     $pkey = Horde_Pgp_Element_PrivateKey::create($this->_getFixture($file));
     return is_null($pass) ? $pkey : $pkey->getUnencryptedKey($pass);
 }