From 0a85e214a620f211d2d15ee31eb8a5d07eeae8cc Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 31 Mar 2010 14:25:21 -0500 Subject: [PATCH] Implement to_bytes for OpenPGP_Message --- lib/openpgp.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/openpgp.php b/lib/openpgp.php index 7cbb9df..9849d1e 100644 --- a/lib/openpgp.php +++ b/lib/openpgp.php @@ -141,6 +141,14 @@ class OpenPGP_Message implements IteratorAggregate, ArrayAccess { $this->packets = $packets; } + function to_bytes() { + $bytes = ''; + foreach($this as $p) { + $bytes .= $p->to_bytes(); + } + return $bytes; + } + // IteratorAggregate interface function getIterator() {