Package io.github.mahmoudimus.quic.tls
Record Class Grease
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.tls.Grease
- Record Components:
cipher- the GREASE cipher suitegroup- the GREASE named group, insupported_groupsandkey_shareextension1- the type of the first GREASE extensionextension2- the type of the last GREASE extensionversion- the GREASE version insupported_versionssignature- the GREASE signature scheme insignature_algorithms
public record Grease(int cipher, int group, int extension1, int extension2, int version, int signature)
extends Record
The GREASE values (RFC 8701) one ClientHello uses, drawn per connection the way BoringSSL
draws them: one for the cipher suites, one shared by the supported groups and the key shares,
one for each of the two GREASE extensions (which must differ), one for the supported versions
and one for the signature algorithms.
-
Constructor Summary
ConstructorsConstructorDescriptionGrease(int cipher, int group, int extension1, int extension2, int version, int signature) Creates an instance of aGreaserecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcipher()Returns the value of thecipherrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theextension1record component.intReturns the value of theextension2record component.intgroup()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.static booleanisGrease(int value) Whethervalueis one of the sixteen GREASE values,0x0a0ato0xfafa.static Greaserandom(RandomGenerator random) Draws a hello's values fromrandom.intReturns the value of thesignaturerecord component.final StringtoString()Returns a string representation of this record class.intversion()Returns the value of theversionrecord component.
-
Constructor Details
-
Grease
public Grease(int cipher, int group, int extension1, int extension2, int version, int signature) Creates an instance of aGreaserecord class.- Parameters:
cipher- the value for thecipherrecord componentgroup- the value for thegrouprecord componentextension1- the value for theextension1record componentextension2- the value for theextension2record componentversion- the value for theversionrecord componentsignature- the value for thesignaturerecord component
-
-
Method Details
-
random
Draws a hello's values fromrandom.- Parameters:
random- the source of randomness- Returns:
- the values, with
extension1 != extension2
-
isGrease
public static boolean isGrease(int value) Whethervalueis one of the sixteen GREASE values,0x0a0ato0xfafa.- Parameters:
value- a cipher suite, group, extension type, version or signature scheme- Returns:
- whether it is reserved for GREASE
-
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 with '=='. -
cipher
public int cipher()Returns the value of thecipherrecord component.- Returns:
- the value of the
cipherrecord component
-
group
public int group()Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
extension1
public int extension1()Returns the value of theextension1record component.- Returns:
- the value of the
extension1record component
-
extension2
public int extension2()Returns the value of theextension2record component.- Returns:
- the value of the
extension2record component
-
version
public int version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
signature
public int signature()Returns the value of thesignaturerecord component.- Returns:
- the value of the
signaturerecord component
-