Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implement body for OpenPGP_CompressedDataPacket

  • Loading branch information...
commit b41bc2c533668c0b760f9c064e2bc559e6000856 1 parent 1a1b898
Stephen Paul Weber singpolyma authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 lib/openpgp.php
21 lib/openpgp.php
View
@@ -792,6 +792,27 @@ function read() {
}
}
+ 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() {
Please sign in to comment.
Something went wrong with that request. Please try again.