Class: OpenPGP::Packet::AsymmetricSessionKey
- Inherits:
-
OpenPGP::Packet
- Object
- OpenPGP::Packet
- OpenPGP::Packet::AsymmetricSessionKey
- Defined in:
- lib/openpgp/packet.rb
Overview
OpenPGP Public-Key Encrypted Session Key packet (tag 1).
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
Returns the value of attribute algorithm.
-
#key_id ⇒ Object
Returns the value of attribute key_id.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from OpenPGP::Packet
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
#algorithm ⇒ Object
Returns the value of attribute algorithm.
106 107 108 |
# File 'lib/openpgp/packet.rb', line 106 def algorithm @algorithm end |
#key_id ⇒ Object
Returns the value of attribute key_id.
106 107 108 |
# File 'lib/openpgp/packet.rb', line 106 def key_id @key_id end |
#version ⇒ Object
Returns the value of attribute version.
106 107 108 |
# File 'lib/openpgp/packet.rb', line 106 def version @version end |
Class Method Details
.parse_body(body, options = {}) ⇒ Object
108 109 110 111 112 113 114 115 116 |
# File 'lib/openpgp/packet.rb', line 108 def self.parse_body(body, = {}) case version = body.read_byte when 3 self.new(:version => version, :key_id => body.read_number(8, 16), :algorithm => body.read_byte) # TODO: read the encrypted session key. else raise "Invalid OpenPGP public-key ESK packet version: #{version}" end end |