Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* Partial Body Lengths packet support for loader, too.

  • Loading branch information...
commit fa1ad0974e6eb7ed3caae6b47805d24b8edfac0d 1 parent ac6948f
@nahi authored
Showing with 52 additions and 0 deletions.
  1. +2 −0  lib/pgp/packet.rb
  2. +50 −0 lib/pgp/packet/partial.rb
View
2  lib/pgp/packet.rb
@@ -41,6 +41,8 @@
require 'pgp/packet/userattribute' # Tag 17
require 'pgp/packet/symencryptedintegrityprotecteddata' # Tag 18 and 19
+require 'pgp/packet/partial'
+
module PGP
View
50 lib/pgp/packet/partial.rb
@@ -0,0 +1,50 @@
+# Copyright 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+require 'pgp/packet/packet'
+
+
+module PGP
+module Packet
+
+
+class Partial < Packet
+ def initialize
+ super(-1)
+ @body = nil
+ end
+
+ attr_accessor :body
+
+private
+
+ def dump_body
+ raise "ToDo"
+ end
+
+ def self.loader(port, length)
+ packet = new()
+ packet.body = port.read(length)
+ packet
+ end
+
+ def self.scanner(io, port, length)
+ loader(port, length).scan(io)
+ end
+end
+
+
+end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.