Class: COSE::Sign

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

Returns a new instance of Sign


13
14
15
16
17
18
# File 'lib/cose/sign.rb', line 13

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

  @payload = payload
  @signatures = signatures
end

Instance Attribute Details

#payloadObject (readonly)

Returns the value of attribute payload


7
8
9
# File 'lib/cose/sign.rb', line 7

def payload
  @payload
end

#signaturesObject (readonly)

Returns the value of attribute signatures


7
8
9
# File 'lib/cose/sign.rb', line 7

def signatures
  @signatures
end

Class Method Details

.keyword_arguments_for_initialize(decoded) ⇒ Object


9
10
11
# File 'lib/cose/sign.rb', line 9

def self.keyword_arguments_for_initialize(decoded)
  { payload: CBOR.decode(decoded[0]), signatures: decoded[1].map { |s| COSE::Signature.deserialize(s) } }
end