Record Class Secrets

java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.Secrets
Record Components:
level - the encryption level the secrets protect
suite - the negotiated cipher suite
client - the client's traffic secret (what the client writes with)
server - the server's traffic secret (what the server writes with)

public record Secrets(EncryptionLevel level, CipherSuite suite, byte[] client, byte[] server) extends Record
The traffic secrets for one encryption level, as the TLS handshake hands them to packet protection: one secret per direction and the cipher suite they are for.
  • Constructor Details

    • Secrets

      public Secrets(EncryptionLevel level, CipherSuite suite, byte[] client, byte[] server)
      Creates an instance of a Secrets record class.
      Parameters:
      level - the value for the level record component
      suite - the value for the suite record component
      client - the value for the client record component
      server - the value for the server record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • level

      public EncryptionLevel level()
      Returns the value of the level record component.
      Returns:
      the value of the level record component
    • suite

      public CipherSuite suite()
      Returns the value of the suite record component.
      Returns:
      the value of the suite record component
    • client

      public byte[] client()
      Returns the value of the client record component.
      Returns:
      the value of the client record component
    • server

      public byte[] server()
      Returns the value of the server record component.
      Returns:
      the value of the server record component