Sha256: 4d42f811c9de515d5a75afb48e1939720d8da1f44df225460e8cb129b9bcb1a5

Contents?: true

Size: 514 Bytes

Versions: 5

Compression:

Stored size: 514 Bytes

Contents

# frozen_string_literal: true

require "cose/key/base"

module COSE
  module Key
    class Symmetric < Base
      K_LABEL = -1
      KTY_SYMMETRIC = 4

      attr_reader :key_value

      def initialize(key_value:)
        if !key_value
          raise ArgumentError, "Required key value is missing"
        end

        @key_value = key_value
      end

      def self.from_map(map)
        enforce_type(map, KTY_SYMMETRIC, "Not a Symmetric key")

        new(key_value: map[K_LABEL])
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cose-0.5.0 lib/cose/key/symmetric.rb
cose-0.4.1 lib/cose/key/symmetric.rb
cose-0.4.0 lib/cose/key/symmetric.rb
cose-0.3.0 lib/cose/key/symmetric.rb
cose-0.2.0 lib/cose/key/symmetric.rb