From dc7bc432eaadcabf62bdffddf4da778f12b22b47 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 30 Mar 2010 12:56:50 -0500 Subject: [PATCH] Implement LiteralDataPacket --- lib/openpgp.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/openpgp.php b/lib/openpgp.php index edd25f6..d6a67e6 100644 --- a/lib/openpgp.php +++ b/lib/openpgp.php @@ -508,7 +508,16 @@ class OpenPGP_MarkerPacket extends OpenPGP_Packet { * @see http://tools.ietf.org/html/rfc4880#section-5.9 */ class OpenPGP_LiteralDataPacket extends OpenPGP_Packet { - // TODO + public $format, $filename, $timestamp; + function read() { + $this->size = $this->length - 1 - 4; + $this->format = $this->read_byte(); + $filename_length = ord($this->read_byte()); + $this->size -= $filename_length; + $this->filename = $this->read_bytes($filename_length); + $this->timestamp = $this->read_unpacked(4, 'N'); + $this->data = $this->read_bytes($this->size); + } } /**