Class: ECHConfig::ECHConfigContents::HpkeKeyConfig::HpkeKemId
- Inherits:
-
Object
- Object
- ECHConfig::ECHConfigContents::HpkeKeyConfig::HpkeKemId
- Extended by:
- T::Sig
- Defined in:
- lib/ech_config/ech_config_contents/hpke_key_config/hpke_kem_id.rb
Overview
typed: true frozen_string_literal: true
Instance Attribute Summary collapse
-
#uint16 ⇒ Object
readonly
Returns the value of attribute uint16.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(uint16) ⇒ HpkeKemId
constructor
A new instance of HpkeKemId.
Constructor Details
#initialize(uint16) ⇒ HpkeKemId
Returns a new instance of HpkeKemId.
9 10 11 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_kem_id.rb', line 9 def initialize(uint16) @uint16 = uint16 end |
Instance Attribute Details
#uint16 ⇒ Object (readonly)
Returns the value of attribute uint16.
6 7 8 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_kem_id.rb', line 6 def uint16 @uint16 end |
Class Method Details
.decode(octet) ⇒ Object
19 20 21 22 23 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_kem_id.rb', line 19 def self.decode(octet) raise ::ECHConfig::DecodeError if octet.length != 2 new(octet.unpack1('n')) end |
Instance Method Details
#encode ⇒ Object
14 15 16 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_kem_id.rb', line 14 def encode [@uint16].pack('n') end |