Class: OpenPGP::Packet::Signature

Inherits:
OpenPGP::Packet show all
Defined in:
lib/openpgp/packet.rb

Overview

OpenPGP Signature packet (tag 2).

Instance Attribute Summary collapse

Attributes inherited from OpenPGP::Packet

#data, #size, #tag

Class Method Summary collapse

Methods inherited from OpenPGP::Packet

#body, for, #initialize, parse, parse_new_format, parse_old_format, tag

Constructor Details

This class inherits a constructor from OpenPGP::Packet

Instance Attribute Details

#fieldsObject

Returns the value of attribute fields.



127
128
129
# File 'lib/openpgp/packet.rb', line 127

def fields
  @fields
end

#hash_algorithmObject

Returns the value of attribute hash_algorithm.



125
126
127
# File 'lib/openpgp/packet.rb', line 125

def hash_algorithm
  @hash_algorithm
end

#key_algorithmObject

Returns the value of attribute key_algorithm.



125
126
127
# File 'lib/openpgp/packet.rb', line 125

def key_algorithm
  @key_algorithm
end

#key_idObject

Returns the value of attribute key_id.



126
127
128
# File 'lib/openpgp/packet.rb', line 126

def key_id
  @key_id
end

#typeObject

Returns the value of attribute type.



124
125
126
# File 'lib/openpgp/packet.rb', line 124

def type
  @type
end

#versionObject

Returns the value of attribute version.



124
125
126
# File 'lib/openpgp/packet.rb', line 124

def version
  @version
end

Class Method Details

.parse_body(body, options = {}) ⇒ Object



129
130
131
132
133
134
135
# File 'lib/openpgp/packet.rb', line 129

def self.parse_body(body, options = {})
  case version = body.read_byte
    when 3 then self.new(:version => 3).send(:read_v3_signature, body)
    when 4 then self.new(:version => 4).send(:read_v4_signature, body)
    else raise "Invalid OpenPGP signature packet version: #{version}"
  end
end