Class: ECHConfigList
- Inherits:
-
Object
- Object
- ECHConfigList
- Defined in:
- lib/ech_config.rb,
sig/generated/ech_config.rbs
Instance Method Summary collapse
- #encode ⇒ String
-
#initialize(echconfigs) ⇒ ECHConfigList
constructor
A new instance of ECHConfigList.
- #to_pem ⇒ String
Constructor Details
#initialize(echconfigs) ⇒ ECHConfigList
Returns a new instance of ECHConfigList.
67 68 69 |
# File 'lib/ech_config.rb', line 67 def initialize(echconfigs) @echconfigs = echconfigs end |
Instance Method Details
#encode ⇒ String
72 73 74 |
# File 'lib/ech_config.rb', line 72 def encode @echconfigs.map(&:encode).join.then { |s| [s.length].pack('n') + s } end |
#to_pem ⇒ String
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/ech_config.rb', line 77 def to_pem body = Base64.strict_encode64(encode).scan(/.{1,64}/).join("\n") # https://datatracker.ietf.org/doc/html/rfc9934#section-3 <<~PEM -----BEGIN ECHCONFIG----- #{body} -----END ECHCONFIG----- PEM end |