Package io.github.mahmoudimus.quic.tls
Record Class HelloContext
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.tls.HelloContext
- Record Components:
serverName- the SNI host name, or null to send nonealpnProtocols- the ALPN protocols, in preference order; empty to send no ALPN- each key share's public key, by named group code, as the share carries itgrease- the hello's GREASE valuesrandom- the source of the hello's random bytes; aSecureRandomon a real connectionsupplied- extension bodies the connection makes itself, by type, such as QUIC'squic_transport_parameters, forProfileExtensions.supplied(int)pskLength- the length of thepre_shared_keybody the client adds after the profile's extensions when it resumes a session, 0 when it does not: what a browser that treats a resumption differently (Firefox leaves outsession_ticket, and sizes its GREASE ECH with the PSK) needs to know
public record HelloContext(String serverName, List<String> alpnProtocols, Map<Integer,byte[]> keyShares, Grease grease, RandomGenerator random, Map<Integer,byte[]> supplied, int pskLength)
extends Record
What one ClientHello says that its profile does not: the server's name, the ALPN protocols
offered on this connection, the public keys of the key shares, the GREASE values, and where
the random bytes (client random, session id, GREASE ECH, shuffling) come from.
-
Constructor Summary
ConstructorsConstructorDescriptionHelloContext(String serverName, List<String> alpnProtocols, Map<Integer, byte[]> keyShares, Grease grease, RandomGenerator random) A context with no supplied extension bodies.HelloContext(String serverName, List<String> alpnProtocols, Map<Integer, byte[]> keyShares, Grease grease, RandomGenerator random, Map<Integer, byte[]> supplied) A context for a hello that resumes no session.HelloContext(String serverName, List<String> alpnProtocols, Map<Integer, byte[]> keyShares, Grease grease, RandomGenerator random, Map<Integer, byte[]> supplied, int pskLength) Creates an instance of aHelloContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealpnProtocolsrecord component.final booleanIndicates whether some other object is "equal to" this one.grease()Returns the value of thegreaserecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thekeySharesrecord component.intReturns the value of thepskLengthrecord component.random()Returns the value of therandomrecord component.booleanresuming()Returns whether the hello resumes a session with a PSK.Returns the value of theserverNamerecord component.supplied()Returns the value of thesuppliedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HelloContext
public HelloContext(String serverName, List<String> alpnProtocols, Map<Integer, byte[]> keyShares, Grease grease, RandomGenerator random, Map<Integer, byte[]> supplied, int pskLength) Creates an instance of aHelloContextrecord class.- Parameters:
serverName- the value for theserverNamerecord componentalpnProtocols- the value for thealpnProtocolsrecord componentkeyShares- the value for thekeySharesrecord componentgrease- the value for thegreaserecord componentrandom- the value for therandomrecord componentsupplied- the value for thesuppliedrecord componentpskLength- the value for thepskLengthrecord component
-
HelloContext
public HelloContext(String serverName, List<String> alpnProtocols, Map<Integer, byte[]> keyShares, Grease grease, RandomGenerator random, Map<Integer, byte[]> supplied) A context for a hello that resumes no session. -
HelloContext
public HelloContext(String serverName, List<String> alpnProtocols, Map<Integer, byte[]> keyShares, Grease grease, RandomGenerator random) A context with no supplied extension bodies.
-
-
Method Details
-
resuming
public boolean resuming()Returns whether the hello resumes a session with a PSK.- Returns:
- whether the hello resumes a session with a PSK
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
serverName
Returns the value of theserverNamerecord component.- Returns:
- the value of the
serverNamerecord component
-
alpnProtocols
Returns the value of thealpnProtocolsrecord component.- Returns:
- the value of the
alpnProtocolsrecord component
-
grease
Returns the value of thegreaserecord component.- Returns:
- the value of the
greaserecord component
-
random
Returns the value of therandomrecord component.- Returns:
- the value of the
randomrecord component
-
supplied
Returns the value of thesuppliedrecord component.- Returns:
- the value of the
suppliedrecord component
-
pskLength
public int pskLength()Returns the value of thepskLengthrecord component.- Returns:
- the value of the
pskLengthrecord component
-