Class: COSE::Recipient

Inherits:
SecurityMessage show all
Defined in:
lib/cose/recipient.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: nil, **keyword_arguments) ⇒ Recipient


17
18
19
20
21
22
# File 'lib/cose/recipient.rb', line 17

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

  @ciphertext = ciphertext
  @recipients = recipients
end

Instance Attribute Details

#ciphertextObject (readonly)

Returns the value of attribute ciphertext


5
6
7
# File 'lib/cose/recipient.rb', line 5

def ciphertext
  @ciphertext
end

#recipientsObject (readonly)

Returns the value of attribute recipients


5
6
7
# File 'lib/cose/recipient.rb', line 5

def recipients
  @recipients
end

Class Method Details

.keyword_arguments_for_initialize(decoded) ⇒ Object


7
8
9
10
11
12
13
14
15
# File 'lib/cose/recipient.rb', line 7

def self.keyword_arguments_for_initialize(decoded)
  keyword_arguments = { ciphertext: decoded[0] }

  if decoded[1]
    keyword_arguments[:recipients] = decoded[1].map { |s| COSE::Recipient.deserialize(s) }
  end

  keyword_arguments
end