From b42ec74ab4dbe698d9a37abd42534a50adc676fa Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Thu, 1 Apr 2010 18:03:12 -0500 Subject: [PATCH] Conveniance function to get issuer --- lib/openpgp.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/openpgp.php b/lib/openpgp.php index 2192622..5eda640 100644 --- a/lib/openpgp.php +++ b/lib/openpgp.php @@ -489,6 +489,16 @@ class OpenPGP_SignaturePacket extends OpenPGP_Packet { return self::$hash_algorithms[$this->hash_algorithm]; } + function issuer() { + foreach($this->hashed_subpackets as $p) { + if($p instanceof OpenPGP_SignaturePacket_IssuerPacket) return $p->data; + } + foreach($this->unhashed_subpackets as $p) { + if($p instanceof OpenPGP_SignaturePacket_IssuerPacket) return $p->data; + } + return NULL; + } + /** * @see http://tools.ietf.org/html/rfc4880#section-5.2.3.1 */