Sha256: edaaf598aa0fdc23feb08f8a33114452a99a90c4912da53c912997788397da77

Contents?: true

Size: 344 Bytes

Versions: 2

Compression:

Stored size: 344 Bytes

Contents

# frozen_string_literal: true

require "cbor"

module COSE
  module Key
    class Base
      LABEL_KTY = 1

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cose-0.5.0 lib/cose/key/base.rb
cose-0.4.1 lib/cose/key/base.rb