Package io.github.mahmoudimus.quic.tls
Class SessionTicket
java.lang.Object
io.github.mahmoudimus.quic.tls.SessionTicket
A session ticket a client received in a NewSessionTicket message (RFC 8446 section 4.6.1),
with what it needs to resume the session: the pre-shared key derived from the resumption master
secret, the cipher suite, the ticket age obfuscation, and for 0-RTT the ALPN protocol and the
server's QUIC transport parameters, which a client must remember and use for its early data
(RFC 9000 section 7.4.1).
A ticket is meant to be used once (RFC 8446 appendix C.4): a ClientSessionStore
hands each out once. Tickets hold secrets and live only in memory. Immutable.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longmax_early_data_sizein a ticket that allows QUIC 0-RTT (RFC 9001 section 4.6.1). -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the ticket allows 0-RTT data.alpn()The application protocol of the session, which 0-RTT data is sent for.The cipher suite of the session; a resumption must use one with the same hash, and 0-RTT this very suite.booleanWhether the ticket has outlived its lifetime.lifetime()How long the server said the ticket may be used.The server's certificate chain from the full handshake the session started with.received()When the client received the ticket.The server name the ticket is for, as the client sent it in SNI.toString()byte[]The server's encoded QUIC transport parameters from the session the ticket came from.
-
Field Details
-
QUIC_MAX_EARLY_DATA
public static final long QUIC_MAX_EARLY_DATAmax_early_data_sizein a ticket that allows QUIC 0-RTT (RFC 9001 section 4.6.1).- See Also:
-
-
Method Details
-
serverName
The server name the ticket is for, as the client sent it in SNI.- Returns:
- the name, or null if the client sent none
-
cipherSuite
The cipher suite of the session; a resumption must use one with the same hash, and 0-RTT this very suite.- Returns:
- the suite
-
alpn
The application protocol of the session, which 0-RTT data is sent for.- Returns:
- the protocol
-
allowsEarlyData
public boolean allowsEarlyData()Whether the ticket allows 0-RTT data.- Returns:
- true if the server sent
early_datawith QUIC'smax_early_data_size
-
transportParameters
public byte[] transportParameters()The server's encoded QUIC transport parameters from the session the ticket came from. A client sending 0-RTT data must keep within their limits.- Returns:
- a copy, or null if unknown
-
peerCertificates
The server's certificate chain from the full handshake the session started with.- Returns:
- the chain, end-entity first
-
received
When the client received the ticket.- Returns:
- the time
-
lifetime
How long the server said the ticket may be used.- Returns:
- the lifetime, at most 7 days
-
isExpired
Whether the ticket has outlived its lifetime.- Parameters:
now- the current time- Returns:
- true once it must no longer be offered
-
toString
-