From 5829037d0b3847af63cb99ddb15a2dbf3b99c003 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Thu, 1 Apr 2010 09:17:40 -0500 Subject: [PATCH] SignatureSubpacket constructor (for tag/type) --- lib/openpgp.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/openpgp.php b/lib/openpgp.php index 13d6a9a..800debe 100644 --- a/lib/openpgp.php +++ b/lib/openpgp.php @@ -543,6 +543,11 @@ class OpenPGP_SignaturePacket extends OpenPGP_Packet { } class OpenPGP_SignaturePacket_Subpacket extends OpenPGP_Packet { + function __construct($data=NULL) { + parent::__construct($data); + $this->tag = array_search(substr(substr(get_class($this), 8+16), 0, -6), OpenPGP_SignaturePacket::$subpacket_types); + } + function header_and_body() { $body = $this->body(); // Get body first, we will need it's length $size = chr(255).pack('N', strlen($body)+1); // Use 5-octet lengths + 1 for tag as first packet body octet