Class: COSE::Key::OKP

Inherits:
CurveKey show all
Defined in:
lib/cose/key/okp.rb

Constant Summary collapse

KTY_OKP =
1

Constants inherited from CurveKey

CurveKey::LABEL_CRV, CurveKey::LABEL_D, CurveKey::LABEL_X

Constants inherited from Base

Base::LABEL_ALG, Base::LABEL_BASE_IV, Base::LABEL_KEY_OPS, Base::LABEL_KID, Base::LABEL_KTY

Instance Attribute Summary

Attributes inherited from CurveKey

#crv, #d, #x

Attributes inherited from Base

#alg, #base_iv, #key_ops, #kid

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CurveKey

#initialize, keyword_arguments_for_initialize

Methods inherited from Base

deserialize, from_map, #initialize, #serialize

Constructor Details

This class inherits a constructor from COSE::Key::CurveKey

Class Method Details

.enforce_type(map) ⇒ Object



11
12
13
14
15
# File 'lib/cose/key/okp.rb', line 11

def self.enforce_type(map)
  if map[LABEL_KTY] != KTY_OKP
    raise "Not an OKP key"
  end
end

Instance Method Details

#mapObject



17
18
19
# File 'lib/cose/key/okp.rb', line 17

def map
  super.merge(LABEL_KTY => KTY_OKP)
end