Class: COSE::Sign1

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

Returns a new instance of Sign1


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

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

  @payload = payload
  @signature = signature
end

Instance Attribute Details

#payloadObject (readonly)

Returns the value of attribute payload


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

def payload
  @payload
end

#signatureObject (readonly)

Returns the value of attribute signature


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

def signature
  @signature
end

Class Method Details

.keyword_arguments_for_initialize(decoded) ⇒ Object


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

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