Class: TTTLS13::Message::Finished
- Inherits:
-
Object
- Object
- TTTLS13::Message::Finished
- Defined in:
- lib/tttls1.3/message/finished.rb
Instance Attribute Summary collapse
-
#msg_type ⇒ Object
readonly
Returns the value of attribute msg_type.
-
#verify_data ⇒ Object
readonly
Returns the value of attribute verify_data.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(verify_data) ⇒ Finished
constructor
A new instance of Finished.
- #serialize ⇒ String (also: #fragment)
Constructor Details
#initialize(verify_data) ⇒ Finished
Returns a new instance of Finished.
12 13 14 15 |
# File 'lib/tttls1.3/message/finished.rb', line 12 def initialize(verify_data) @msg_type = HandshakeType::FINISHED @verify_data = verify_data end |
Instance Attribute Details
#msg_type ⇒ Object (readonly)
Returns the value of attribute msg_type.
8 9 10 |
# File 'lib/tttls1.3/message/finished.rb', line 8 def msg_type @msg_type end |
#verify_data ⇒ Object (readonly)
Returns the value of attribute verify_data.
9 10 11 |
# File 'lib/tttls1.3/message/finished.rb', line 9 def verify_data @verify_data end |
Class Method Details
.deserialize(binary) ⇒ TTTLS13::Message::Finished
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/tttls1.3/message/finished.rb', line 29 def self.deserialize(binary) raise Error::ErrorAlerts, :internal_error if binary.nil? raise Error::ErrorAlerts, :decode_error if binary.length < 4 raise Error::ErrorAlerts, :internal_error \ unless binary[0] == HandshakeType::FINISHED msg_len = Convert.bin2i(binary.slice(1, 3)) verify_data = binary.slice(4, msg_len) raise Error::ErrorAlerts, :decode_error \ unless msg_len + 4 == binary.length Finished.new(verify_data) end |
Instance Method Details
#serialize ⇒ String Also known as: fragment
18 19 20 |
# File 'lib/tttls1.3/message/finished.rb', line 18 def serialize @msg_type + @verify_data.prefix_uint24_length end |