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