Package io.github.mahmoudimus.quic
Enum Class CipherSuite
- All Implemented Interfaces:
Serializable,Comparable<CipherSuite>,Constable
The TLS 1.3 cipher suites QUIC can use (RFC 9001 section 5.3), with what packet protection needs
to know about each: its HKDF hash, AEAD and key length.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTLS_AES_128_GCM_SHA256, also used for Initial packets.TLS_AES_256_GCM_SHA384.TLS_CHACHA20_POLY1305_SHA256. -
Method Summary
Modifier and TypeMethodDescriptionaead()The JCA transformation of the suite's AEAD.booleanaes()Whether header protection uses AES (as opposed to ChaCha20).intcode()The suite's TLS code point.static CipherSuiteforCode(int code) The suite with a TLS code point.hkdf()The HKDF over the suite's hash.intThe AEAD key length, which is also the header protection key length.static CipherSuiteReturns the enum constant of this class with the specified name.static CipherSuite[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TLS_AES_128_GCM_SHA256
TLS_AES_128_GCM_SHA256, also used for Initial packets. -
TLS_AES_256_GCM_SHA384
TLS_AES_256_GCM_SHA384. -
TLS_CHACHA20_POLY1305_SHA256
TLS_CHACHA20_POLY1305_SHA256.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
code
public int code()The suite's TLS code point.- Returns:
- the two-byte code, such as
0x1301
-
hkdf
The HKDF over the suite's hash.- Returns:
- the HKDF
-
aead
The JCA transformation of the suite's AEAD.- Returns:
"AES/GCM/NoPadding"or"ChaCha20-Poly1305"
-
keyLength
public int keyLength()The AEAD key length, which is also the header protection key length.- Returns:
- the key length in bytes
-
aes
public boolean aes()Whether header protection uses AES (as opposed to ChaCha20).- Returns:
- true for the AES-GCM suites
-
forCode
The suite with a TLS code point.- Parameters:
code- the code point- Returns:
- the suite, or null if QUIC cannot use it
-