Class: COSE::Mac0

Inherits:
SecurityMessage show all
Defined in:
lib/cose/mac0.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(payload:, tag:, **keyword_arguments) ⇒ Mac0

Returns a new instance of Mac0


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

def initialize(payload:, tag:, **keyword_arguments)
  super(**keyword_arguments)

  @payload = payload
  @tag = tag
end

Instance Attribute Details

#payloadObject (readonly)

Returns the value of attribute payload


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

def payload
  @payload
end

#tagObject (readonly)

Returns the value of attribute tag


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

def tag
  @tag
end

Class Method Details

.keyword_arguments_for_initialize(decoded) ⇒ Object


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

def self.keyword_arguments_for_initialize(decoded)
  { payload: CBOR.decode(decoded[0]), tag: decoded[1] }
end