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.
8 9 10 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_public_key.rb', line 8 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
18 19 20 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_public_key.rb', line 18 def self.decode(octet) new(octet) end |
Instance Method Details
#encode ⇒ Object
13 14 15 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_public_key.rb', line 13 def encode @opaque.then { |s| [s.length].pack('n') + s } end |