Implement body for OpenPGP_CompressedDataPacket

This commit is contained in:
Stephen Paul Weber 2010-03-31 14:26:16 -05:00
parent 1a1b8980e6
commit b41bc2c533
1 changed files with 21 additions and 0 deletions

View File

@ -792,6 +792,27 @@ class OpenPGP_CompressedDataPacket extends OpenPGP_Packet implements IteratorAgg
}
}
function body() {
$body = chr($this->algorithm);
switch($this->algorithm) {
case 0:
$body .= $this->data->to_bytes();
break;
case 1:
$body .= gzdeflate($this->data->to_bytes());
break;
case 2:
$body .= gzcompress($this->data->to_bytes());
break;
case 3:
$body .= bzcompress($this->data->to_bytes());
break;
default:
/* TODO error? */
}
return $body;
}
// IteratorAggregate interface
function getIterator() {