Class: Dropzone::Communication
- Inherits:
-
MessageBase
- Object
- RecordBase
- MessageBase
- Dropzone::Communication
- Defined in:
- lib/dropzone/communication.rb
Defined Under Namespace
Constant Summary
Constants inherited from MessageBase
Instance Attribute Summary collapse
-
#symm_key ⇒ Object
Returns the value of attribute symm_key.
Attributes inherited from MessageBase
#block_height, #message_type, #receiver_addr, #sender_addr, #txid
Instance Method Summary collapse
Methods inherited from MessageBase
attr_message, attr_message_int, attr_message_pkey, #data_to_hash, #data_to_hex, find, #initialize, is_attr_int?, is_attr_pkey?, message_attribs, message_type, new_message_from, #save!, #to_transaction, types_include?
Methods inherited from RecordBase
Constructor Details
This class inherits a constructor from Dropzone::MessageBase
Instance Attribute Details
#symm_key ⇒ Object
Returns the value of attribute symm_key.
9 10 11 |
# File 'lib/dropzone/communication.rb', line 9 def symm_key @symm_key end |
Instance Method Details
#contents_plain ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/dropzone/communication.rb', line 11 def contents_plain raise NoSymmKey unless symm_key aes = OpenSSL::Cipher::Cipher.new Session::CIPHER_ALGORITHM aes.decrypt aes.key = symm_key aes.iv = iv aes.update(contents) + aes.final end |
#is_auth? ⇒ Boolean
23 |
# File 'lib/dropzone/communication.rb', line 23 def is_auth?; !session_pkey.nil?; end |
#is_init? ⇒ Boolean
22 |
# File 'lib/dropzone/communication.rb', line 22 def is_init?; (der && session_pkey); end |