Class: COSE::Recipient
- Inherits:
-
SecurityMessage
- Object
- SecurityMessage
- COSE::Recipient
- Defined in:
- lib/cose/recipient.rb
Constant Summary
Constants inherited from SecurityMessage
SecurityMessage::ZERO_LENGTH_BIN_STRING
Instance Attribute Summary collapse
-
#ciphertext ⇒ Object
readonly
Returns the value of attribute ciphertext.
-
#recipients ⇒ Object
readonly
Returns the value of attribute recipients.
Attributes inherited from SecurityMessage
#protected_headers, #unprotected_headers
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ciphertext:, recipients: nil, **keyword_arguments) ⇒ Recipient
constructor
A new instance of Recipient.
Methods inherited from SecurityMessage
#algorithm, deserialize, deserialize_headers, from_array, #headers
Constructor Details
#initialize(ciphertext:, recipients: nil, **keyword_arguments) ⇒ Recipient
Returns a new instance of Recipient.
19 20 21 22 23 24 |
# File 'lib/cose/recipient.rb', line 19 def initialize(ciphertext:, recipients: nil, **keyword_arguments) super(**keyword_arguments) @ciphertext = ciphertext @recipients = recipients end |
Instance Attribute Details
#ciphertext ⇒ Object (readonly)
Returns the value of attribute ciphertext.
7 8 9 |
# File 'lib/cose/recipient.rb', line 7 def ciphertext @ciphertext end |
#recipients ⇒ Object (readonly)
Returns the value of attribute recipients.
7 8 9 |
# File 'lib/cose/recipient.rb', line 7 def recipients @recipients end |
Class Method Details
.keyword_arguments_for_initialize(decoded) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/cose/recipient.rb', line 9 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 |