From f09335de1d673c47cbf62dc90f4ec67478395daa Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 30 Mar 2010 13:12:18 -0500 Subject: [PATCH] Implement OnePassSignaturePacket --- lib/openpgp.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/openpgp.php b/lib/openpgp.php index bb63ae0..036968d 100644 --- a/lib/openpgp.php +++ b/lib/openpgp.php @@ -354,7 +354,17 @@ class OpenPGP_SymmetricSessionKeyPacket extends OpenPGP_Packet { * @see http://tools.ietf.org/html/rfc4880#section-5.4 */ class OpenPGP_OnePassSignaturePacket extends OpenPGP_Packet { - // TODO + public $version, $signature_type, $hash_algorithm, $key_algorithm, $key_id, $nested; + function read() { + $this->version = ord($this->read_byte()); + $this->signature_type = ord($this->read_byte()); + $this->hash_algorithm = ord($this->read_byte()); + $this->key_algorithm = ord($this->read_byte()); + for($i = 0; $i < 8; $i++) { // Store KeyID in Hex + $this->key_id .= dechex(ord($this->read_byte())); + } + $this->nested = ord($this->read_byte()); + } } /**