Class: TTTLS13::Message::Extension::ECHEncryptedExtensions
- Inherits:
-
Object
- Object
- TTTLS13::Message::Extension::ECHEncryptedExtensions
- Defined in:
- lib/tttls1.3/message/extension/ech.rb
Overview
struct {
ECHConfigList retry_configs;
} ECHEncryptedExtensions;
Instance Attribute Summary collapse
-
#extension_type ⇒ Object
readonly
Returns the value of attribute extension_type.
-
#retry_configs ⇒ Object
readonly
Returns the value of attribute retry_configs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(retry_configs) ⇒ ECHEncryptedExtensions
constructor
A new instance of ECHEncryptedExtensions.
- #serialize ⇒ String
Constructor Details
#initialize(retry_configs) ⇒ ECHEncryptedExtensions
Returns a new instance of ECHEncryptedExtensions.
169 170 171 172 |
# File 'lib/tttls1.3/message/extension/ech.rb', line 169 def initialize(retry_configs) @extension_type = ExtensionType::ENCRYPTED_CLIENT_HELLO @retry_configs = retry_configs end |
Instance Attribute Details
#extension_type ⇒ Object (readonly)
Returns the value of attribute extension_type.
166 167 168 |
# File 'lib/tttls1.3/message/extension/ech.rb', line 166 def extension_type @extension_type end |
#retry_configs ⇒ Object (readonly)
Returns the value of attribute retry_configs.
166 167 168 |
# File 'lib/tttls1.3/message/extension/ech.rb', line 166 def retry_configs @retry_configs end |
Class Method Details
.deserialize(binary) ⇒ TTTLS13::Message::Extensions::ECHEncryptedExtensions
187 188 189 190 191 192 193 194 |
# File 'lib/tttls1.3/message/extension/ech.rb', line 187 def self.deserialize(binary) raise Error::ErrorAlerts, :internal_error if binary.nil? return nil if binary.length != binary.slice(0, 2).unpack1('n') + 2 ECHEncryptedExtensions.new( ECHConfig.decode_vectors(binary.slice(2..)) ) end |
Instance Method Details
#serialize ⇒ String
175 176 177 178 179 180 |
# File 'lib/tttls1.3/message/extension/ech.rb', line 175 def serialize @extension_type + @retry_configs.map(&:encode) .join .prefix_uint16_length .prefix_uint16_length end |