public function getUnencryptedKey($passphrase = null)
{
$out = null;
foreach ($this->_getSecretKeyPackets() as $k => $v) {
if (!strlen($v->encrypted_data)) {
continue;
}
if (is_null($out)) {
$out = clone $this->message;
}
$out[$k] = OpenPGP_Crypt_Symmetric::decryptSecretKey($passphrase, $v);
if (is_null($out[$k])) {
throw new Horde_Pgp_Exception(Horde_Pgp_Translation::t("Could not unencrypt private key."));
}
}
return new Horde_Pgp_Element_PrivateKey($out);
}