Class: COSE::Mac
- Inherits:
-
Mac0
- Object
- SecurityMessage
- Mac0
- COSE::Mac
- Defined in:
- lib/cose/mac.rb
Constant Summary collapse
- CONTEXT =
"MAC"
Constants inherited from SecurityMessage
SecurityMessage::ZERO_LENGTH_BIN_STRING
Instance Attribute Summary collapse
-
#recipients ⇒ Object
readonly
Returns the value of attribute recipients.
Attributes inherited from Mac0
Attributes inherited from SecurityMessage
#protected_headers, #unprotected_headers
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(recipients:, **keyword_arguments) ⇒ Mac
constructor
A new instance of Mac.
- #verify(key, external_aad = nil) ⇒ Object
Methods inherited from SecurityMessage
#algorithm, deserialize, deserialize_headers, from_array, #headers
Constructor Details
#initialize(recipients:, **keyword_arguments) ⇒ Mac
Returns a new instance of Mac.
20 21 22 23 24 |
# File 'lib/cose/mac.rb', line 20 def initialize(recipients:, **keyword_arguments) super(**keyword_arguments) @recipients = recipients end |
Instance Attribute Details
#recipients ⇒ Object (readonly)
Returns the value of attribute recipients.
10 11 12 |
# File 'lib/cose/mac.rb', line 10 def recipients @recipients end |
Class Method Details
.keyword_arguments_for_initialize(decoded) ⇒ Object
12 13 14 |
# File 'lib/cose/mac.rb', line 12 def self.keyword_arguments_for_initialize(decoded) super.merge(recipients: decoded.last.map { |r| COSE::Recipient.from_array(r) }) end |
.tag ⇒ Object
16 17 18 |
# File 'lib/cose/mac.rb', line 16 def self.tag 97 end |