Record Class EarlyDataAttempt

java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.tls.EarlyDataAttempt
Record Components:
serverName - the server name of the ClientHello (and of the ticket), or null
alpn - the application protocol selected for this connection, which the ticket's matches
ticketId - a random identifier of the ticket, unique per ticket the server issued
issued - when the server issued the ticket
clientTicketAge - the ticket's age the client reports, de-obfuscated
serverTicketAge - the ticket's age by the server's clock

public record EarlyDataAttempt(String serverName, String alpn, byte[] ticketId, Instant issued, Duration clientTicketAge, Duration serverTicketAge) extends Record
A resuming client's offer of 0-RTT data, as an EarlyDataPolicy sees it.
  • Constructor Details

    • EarlyDataAttempt

      public EarlyDataAttempt(String serverName, String alpn, byte[] ticketId, Instant issued, Duration clientTicketAge, Duration serverTicketAge)
      An attempt.
      Parameters:
      serverName - the server name, or null
      alpn - the selected application protocol
      ticketId - the ticket's identifier, copied
      issued - when the ticket was issued
      clientTicketAge - the client's ticket age
      serverTicketAge - the server's ticket age
  • Method Details

    • ticketId

      public byte[] ticketId()
      The ticket's identifier.
      Returns:
      a copy
    • ageSkew

      public Duration ageSkew()
      How far the two ticket ages differ: a replay of an old first flight shows up as a large difference, since the client's reported age is frozen in it.
      Returns:
      the absolute difference
    • 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.
    • serverName

      public String serverName()
      Returns the value of the serverName record component.
      Returns:
      the value of the serverName record component
    • alpn

      public String alpn()
      Returns the value of the alpn record component.
      Returns:
      the value of the alpn record component
    • issued

      public Instant issued()
      Returns the value of the issued record component.
      Returns:
      the value of the issued record component
    • clientTicketAge

      public Duration clientTicketAge()
      Returns the value of the clientTicketAge record component.
      Returns:
      the value of the clientTicketAge record component
    • serverTicketAge

      public Duration serverTicketAge()
      Returns the value of the serverTicketAge record component.
      Returns:
      the value of the serverTicketAge record component