class SvcbRrPatch::SvcParams::Ech::ECHConfigContents::HpkeKeyConfig::HpkePublicKey

Attributes

opaque[R]

Public Class Methods

decode(octet) click to toggle source

:nodoc

# File lib/svcb_rr_patch/svc_params/ech/echconfig_contents/hpke_key_config/hpke_public_key.rb, line 17
def self.decode(octet)
  new(octet)
end
new(opaque) click to toggle source

@param opaque [String]

# File lib/svcb_rr_patch/svc_params/ech/echconfig_contents/hpke_key_config/hpke_public_key.rb, line 7
def initialize(opaque)
  @opaque = opaque
end

Public Instance Methods

encode() click to toggle source

@return [String]

# File lib/svcb_rr_patch/svc_params/ech/echconfig_contents/hpke_key_config/hpke_public_key.rb, line 12
def encode
  @opaque.then { |s| [s.length].pack('n') + s }
end