Class: COSE::Encrypt

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

Instance Attribute Summary collapse

Attributes inherited from SecurityMessage

#protected_headers, #unprotected_headers

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SecurityMessage

deserialize

Constructor Details

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

Returns a new instance of Encrypt


12
13
14
15
16
17
# File 'lib/cose/encrypt.rb', line 12

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


6
7
8
# File 'lib/cose/encrypt.rb', line 6

def ciphertext
  @ciphertext
end

#recipientsObject (readonly)

Returns the value of attribute recipients


6
7
8
# File 'lib/cose/encrypt.rb', line 6

def recipients
  @recipients
end

Class Method Details

.keyword_arguments_for_initialize(decoded) ⇒ Object


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

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