Class: COSE::Key::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cose/key/base.rb

Direct Known Subclasses

EC2, RSA, Symmetric

Constant Summary collapse

LABEL_KTY =
1

Class Method Summary collapse

Class Method Details

.deserialize(cbor) ⇒ Object


10
11
12
# File 'lib/cose/key/base.rb', line 10

def self.deserialize(cbor)
  from_map(CBOR.decode(cbor))
end

.enforce_type(map, kty, error_message) ⇒ Object


14
15
16
17
18
# File 'lib/cose/key/base.rb', line 14

def self.enforce_type(map, kty, error_message)
  if map[LABEL_KTY] != kty
    raise error_message
  end
end