class
Matter::Session::SecureContext
- Matter::Session::SecureContext
- Reference
- Object
Overview
Secure session context holding encryption keys and state
Defined in:
matter/session/context.crConstructors
Instance Method Summary
- #attestation_challenge : Bytes | Nil
- #attestation_challenge=(attestation_challenge : Bytes | Nil)
-
#creation_time : Time
Session metadata
-
#creation_time=(creation_time : Time)
Session metadata
- #decryption_key : Bytes
- #decryption_key=(decryption_key : Bytes)
-
#encryption_key : Bytes
Encryption keys
-
#encryption_key=(encryption_key : Bytes)
Encryption keys
-
#expired?(idle_timeout : Time::Span = 5.minutes) : Bool
Check if session is expired based on idle time
- #is_initiator : Bool
- #is_initiator=(is_initiator : Bool)
- #last_activity_time : Time
- #last_activity_time=(last_activity_time : Time)
-
#local_message_counter : UInt32
Message counters for replay protection
-
#local_message_counter=(local_message_counter : UInt32)
Message counters for replay protection
- #local_node_id : DataType::NodeId | Nil
- #local_node_id=(local_node_id : DataType::NodeId | Nil)
- #max_message_counter : UInt32
- #max_message_counter=(max_message_counter : UInt32)
-
#next_message_counter : UInt32
Get the next message counter and increment
- #peer_message_counter : UInt32 | Nil
- #peer_message_counter=(peer_message_counter : UInt32 | Nil)
- #peer_node_id : DataType::NodeId | Nil
- #peer_node_id=(peer_node_id : DataType::NodeId | Nil)
- #peer_session_id : UInt16
- #peer_session_id=(peer_session_id : UInt16)
- #session_id : UInt16
- #session_id=(session_id : UInt16)
- #session_type : SessionType
- #session_type=(session_type : SessionType)
-
#set_last_activity_time(time : Time)
Set activity time (for testing)
-
#update_activity
Update activity timestamp
-
#validate_message_counter(received_counter : UInt32) : Bool
Validate received message counter (prevent replay attacks)
Constructor Detail
def self.new(session_id : UInt16, peer_session_id : UInt16, session_type : SessionType, encryption_key : Bytes, decryption_key : Bytes, is_initiator : Bool = true, peer_node_id : DataType::NodeId | Nil = nil, local_node_id : DataType::NodeId | Nil = nil, attestation_challenge : Bytes | Nil = nil)
#
Instance Method Detail
def expired?(idle_timeout : Time::Span = 5.minutes) : Bool
#
Check if session is expired based on idle time
def validate_message_counter(received_counter : UInt32) : Bool
#
Validate received message counter (prevent replay attacks)