Class: TTTLS13::Message::EndOfEarlyData

Inherits:
Object
  • Object
show all
Defined in:
lib/tttls1.3/message/end_of_early_data.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEndOfEarlyData

Returns a new instance of EndOfEarlyData.



10
11
12
# File 'lib/tttls1.3/message/end_of_early_data.rb', line 10

def initialize
  @msg_type = HandshakeType::END_OF_EARLY_DATA
end

Instance Attribute Details

#msg_typeObject (readonly)

Returns the value of attribute msg_type.



8
9
10
# File 'lib/tttls1.3/message/end_of_early_data.rb', line 8

def msg_type
  @msg_type
end

Class Method Details

.deserialize(binary) ⇒ TTTLS13::Message::EndOfEarlyData

Parameters:

  • binary (String)

Returns:

Raises:



24
25
26
27
28
29
30
31
32
33
# File 'lib/tttls1.3/message/end_of_early_data.rb', line 24

def self.deserialize(binary)
  raise Error::ErrorAlerts, :internal_error if binary.nil?
  raise Error::ErrorAlerts, :decode_error unless binary.length == 4
  raise Error::ErrorAlerts, :unexpected_message \
    unless binary[0] == HandshakeType::END_OF_EARLY_DATA
  raise Error::ErrorAlerts, :decode_error \
    unless binary == "\x05\x00\x00\x00"

  EndOfEarlyData.new
end

Instance Method Details

#serializeString

Returns:

  • (String)


15
16
17
# File 'lib/tttls1.3/message/end_of_early_data.rb', line 15

def serialize
  @msg_type + ''.prefix_uint24_length
end