Class: COSE::Encrypt

Inherits:
SecurityMessage show all
Defined in:
lib/cose/encrypt.rb

Constant Summary

Constants inherited from SecurityMessage

SecurityMessage::ZERO_LENGTH_BIN_STRING

Instance Attribute Summary collapse

Attributes inherited from SecurityMessage

#protected_headers, #unprotected_headers

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SecurityMessage

#algorithm, deserialize, deserialize_headers, from_array, #headers

Constructor Details

#initialize(ciphertext:, recipients:, **keyword_arguments) ⇒ Encrypt

Returns a new instance of Encrypt.



14
15
16
17
18
19
# File 'lib/cose/encrypt.rb', line 14

def initialize(ciphertext:, recipients:, **keyword_arguments)
  super(**keyword_arguments)

  @ciphertext = ciphertext
  @recipients = recipients
end

Instance Attribute Details

#ciphertextObject (readonly)

Returns the value of attribute ciphertext.



8
9
10
# File 'lib/cose/encrypt.rb', line 8

def ciphertext
  @ciphertext
end

#recipientsObject (readonly)

Returns the value of attribute recipients.



8
9
10
# File 'lib/cose/encrypt.rb', line 8

def recipients
  @recipients
end

Class Method Details

.keyword_arguments_for_initialize(decoded) ⇒ Object



10
11
12
# File 'lib/cose/encrypt.rb', line 10

def self.keyword_arguments_for_initialize(decoded)
  { ciphertext: decoded[0], recipients: decoded[1].map { |s| COSE::Recipient.deserialize(s) } }
end