Record Class DirectionalKeys
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.crypto.DirectionalKeys
- Record Components:
header- the header protection keypacket- the payload key
The keys that protect packets in one direction at one encryption level: a header protection
key and a packet (payload) key. Like its parts, an instance is confined to one thread at a time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static DirectionalKeysfromSecret(CipherSuite suite, byte[] secret, QuicVersion version) Derives both keys from one traffic secret (RFC 9001 section 5.1).final inthashCode()Returns a hash code value for this object.header()Returns the value of theheaderrecord component.packet()Returns the value of thepacketrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DirectionalKeys
Keys from their parts.- Parameters:
header- the header protection keypacket- the payload key
-
-
Method Details
-
fromSecret
Derives both keys from one traffic secret (RFC 9001 section 5.1).- Parameters:
suite- the cipher suite the secret belongs tosecret- the traffic secretversion- the QUIC version, which picks the HKDF labels- Returns:
- the keys
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
header
Returns the value of theheaderrecord component.- Returns:
- the value of the
headerrecord component
-
packet
Returns the value of thepacketrecord component.- Returns:
- the value of the
packetrecord component
-