| Modifier and Type | Class and Description |
|---|---|
| public static enum | |
| public static enum | QuicTLSEngine.
Represents the encryption level associated with a packet encryption or decryption. |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuffer | Returns: mask bytes, at least 5.Packet key space keySpace,true for incoming packets, false for outgoing incoming, ByteBuffer sampled data sample)Compute the header protection mask for the given sample, packet key space and direction (incoming/outgoing). |
| public void | consumeHandshakeBytes(QuicTLSEngine.
the key space of the packet in which the provided
crypto data was encountered. keySpace,contents of the next CRYPTO frame payload)This method consumes crypto stream. |
| public void | decryptPacket(QuicTLSEngine.
Packet key space keySpace,full packet number packetNumber, int key phase bit (0 or 1) found on the packet, or -1
if the packet does not have a key phase bit keyPhase, ByteBuffer buffer containing encrypted packet bytes packet, int length of the packet header headerLength, ByteBuffer buffer where decrypted packet bytes will be stored output)Decrypt the given packet bytes using keys for the given packet key space. |
| public void | deriveInitialKeys(QuicVersion
QUIC protocol version quicVersion, ByteBuffer initial destination connection ID connectionId)Derive initial keys for the given QUIC version and connection ID |
| public void | discardKeys(QuicTLSEngine.
The keyspace whose current keys should be discarded keySpaceDiscard the keys used by the |
| public void | encryptPacket(QuicTLSEngine.
Packet key space keySpace,full packet number packetNumber, IntFunction<ByteBuffer> an headerGenerator, ByteBuffer IntFunction which takes a key phase and returns
the packet headerbuffer containing unencrypted packet payload packetPayload, ByteBuffer buffer into which the encrypted packet payload will be written output)Encrypt into |
| public String | Returns: the most recent application protocol value negotiated by the engine. Returns null if no application protocol has yet been negotiated by the engineReturns the most recent application protocol value negotiated by the engine. |
| public int | |
| public QuicTLSEngine. | Returns: the current sending key space (encryption level)Returns the current sending key space (encryption level). |
| public Runnable | Returns: a delegatedRunnable task, or null
if none are available.Returns a delegated |
| public ByteBuffer | Returns: buffer containing data that will be put by caller in a CRYPTO frame, or null if there are no more handshake bytes to send in this key space at this time.the key space of the packet in which the
requested data will be placed keySpaceIf the current handshake state is |
| public SSLSession | Returns: null if this instance is not currently handshaking, or if the current handshake has not progressed far enough to create a basic SSLSession. Otherwise, this method returns theSSLSession currently being negotiated.Returns the SSLSession being constructed during a QUIC handshake. |
| public QuicTLSEngine. | Returns: the HandshakeStateReturns the current handshake state of the connection. |
| public int | Returns: required sample size for header protectionPacket key space keySpaceGet the sample size for header protection algorithm |
| public SSLSession | |
| public SSLParameters | Returns: the SSLParameters in effect for this engine.Returns the SSLParameters in effect for this engine. |
| public Set | Returns: the QUIC versions supported by this engineReturns the QUIC versions supported by this engine. |
| public boolean | Returns: true if this QuicTLSEngine is operating in client mode, false otherwiseReturns true if this QuicTLSEngine is operating in client mode, false otherwise. |
| public boolean | Returns: true if TLS handshake is complete, false otherwise.Returns true if the TLS handshake is considered complete. |
| public boolean | Returns: true if the given keys are availablekey space to check keySpaceChecks whether the keys for the given key space are available. |
| public void | |
| public void | setLocalQuicTransportParameters(ByteBuffer
encoded quic_transport_parameters params)Provide quic_transport_parameters for inclusion in handshake message. |
| public void | setOneRttContext(QuicOneRttContext
the 1-RTT context to set ctx)Sets the |
| public void | setRemoteQuicTransportParametersConsumer(QuicTransportParametersConsumer
consumer for remote quic transport parameters consumer)Set consumer for quic_transport_parameters sent by the remote side. |
| public void | setSSLParameters(SSLParameters
the SSLParameters sslParameters)Sets the |
| public void | setUseClientMode(boolean
true to make this QuicTLSEngine operate in client
mode, false otherwise mode)If |
| public void | signRetryPacket(QuicVersion
Quic version version, ByteBuffer original destination connection ID,
without length originalConnectionId, ByteBuffer retry packet bytes without tag packet, ByteBuffer buffer where integrity tag will be stored output)Sign the provided retry packet. |
| public boolean | Returns: true if handshake state wasNEED_SEND_HANDSHAKE_DONE,
false otherwiseCalled to check if a |
| public boolean | Returns: true if handshake state wasNEED_RECV_HANDSHAKE_DONE,
false otherwiseCalled when HANDSHAKE_DONE message is received from the server. |
| public void | verifyRetryPacket(QuicVersion
Quic version version, ByteBuffer original destination connection ID,
without length originalConnectionId, ByteBuffer retry packet bytes with tag packet)Verify the provided retry packet. |
| public void | versionNegotiated(QuicVersion
the negotiated quicVersion)QuicVersionCalled when the client and the server, during the connection creation handshake, have settled on a Quic version to use for the connection. |
| computeHeaderProtectionMask | back to summary |
|---|---|
| public ByteBuffer computeHeaderProtectionMask(QuicTLSEngine. Compute the header protection mask for the given sample, packet key space and direction (incoming/outgoing).
| |
| consumeHandshakeBytes | back to summary |
|---|---|
| public void consumeHandshakeBytes(QuicTLSEngine. This method consumes crypto stream.
| |
| decryptPacket | back to summary |
|---|---|
| public void decryptPacket(QuicTLSEngine. Decrypt the given packet bytes using keys for the given packet key space. Header protection must be removed before calling this method.
The input buffer contains the packet header and the encrypted packet payload.
The packet header (first The decrypted payload bytes are written to the output buffer. It is recommended to do the decryption in place by using slices of a bigger buffer as the input and output buffer:
+--------+-------------------+----------+
input: | header | encrypted payload | AEAD tag |
+--------+-------------------+----------+
output: | decrypted payload |
+-------------------+
| |
| deriveInitialKeys | back to summary |
|---|---|
| public void deriveInitialKeys(QuicVersion quicVersion, ByteBuffer connectionId) throws IOException Derive initial keys for the given QUIC version and connection ID
| |
| discardKeys | back to summary |
|---|---|
| public void discardKeys(QuicTLSEngine. Discard the keys used by the
Once the keys for a particular
| |
| encryptPacket | back to summary |
|---|---|
| public void encryptPacket(QuicTLSEngine. Encrypt into
Before encrypting the
The
Upon return, the It is recommended to do the encryption in place by using slices of a bigger buffer as the input and output buffer:
+--------+-------------------+
input: | header | plaintext payload |
+--------+-------------------+----------+
output: | encrypted payload | AEAD tag |
+-------------------+----------+
| |
| getApplicationProtocol | back to summary |
|---|---|
| public String getApplicationProtocol() Returns the most recent application protocol value negotiated by the engine. Returns null if no application protocol has yet been negotiated by the engine.
| |
| getAuthTagSize | back to summary |
|---|---|
| public int getAuthTagSize() Get the authentication tag size. Encryption adds this number of bytes.
| |
| getCurrentSendKeySpace | back to summary |
|---|---|
| public QuicTLSEngine. Returns the current sending key space (encryption level).
| |
| getDelegatedTask | back to summary |
|---|---|
| public Runnable getDelegatedTask() Returns a delegated
A call to this method will return each outstanding task exactly once. Multiple delegated tasks can be run in parallel.
| |
| getHandshakeBytes | back to summary |
|---|---|
| public ByteBuffer getHandshakeBytes(QuicTLSEngine. If the current handshake state is
| |
| getHandshakeSession | back to summary |
|---|---|
| public SSLSession getHandshakeSession() Returns the SSLSession being constructed during a QUIC handshake.
| |
| getHandshakeState | back to summary |
|---|---|
| public QuicTLSEngine. Returns the current handshake state of the connection. Sometimes packets that could be decrypted can be received before the handshake has completed, but should not be decrypted until it is complete
| |
| getHeaderProtectionSampleSize | back to summary |
|---|---|
| public int getHeaderProtectionSampleSize(QuicTLSEngine. Get the sample size for header protection algorithm
| |
| getSession | back to summary |
|---|---|
| public SSLSession getSession() Returns the SSLSession.
| |
| getSSLParameters | back to summary |
|---|---|
| public SSLParameters getSSLParameters() Returns the SSLParameters in effect for this engine.
| |
| getSupportedQuicVersions | back to summary |
|---|---|
| public Set Returns the QUIC versions supported by this engine.
| |
| getUseClientMode | back to summary |
|---|---|
| public boolean getUseClientMode() Returns true if this QuicTLSEngine is operating in client mode, false otherwise.
| |
| isTLSHandshakeComplete | back to summary |
|---|---|
| public boolean isTLSHandshakeComplete() Returns true if the TLS handshake is considered complete.
The TLS handshake is considered complete when the TLS stack
has reported that the handshake is complete. This happens when
the TLS stack has both sent a
| |
| keysAvailable | back to summary |
|---|---|
| public boolean keysAvailable(QuicTLSEngine. Checks whether the keys for the given key space are available. Keys are available when they are already computed and not discarded yet.
| |
| restartHandshake | back to summary |
|---|---|
| public void restartHandshake() throws IOException Reset the handshake state and produce a new ClientHello message. When a Quic client receives a Version Negotiation packet, it restarts the handshake by calling this method after updating the transport parameters with the new version information. | |
| setLocalQuicTransportParameters | back to summary |
|---|---|
| public void setLocalQuicTransportParameters(ByteBuffer params) Provide quic_transport_parameters for inclusion in handshake message.
| |
| setOneRttContext | back to summary |
|---|---|
| public void setOneRttContext(QuicOneRttContext ctx) Sets the The
| |
| setRemoteQuicTransportParametersConsumer | back to summary |
|---|---|
| public void setRemoteQuicTransportParametersConsumer(QuicTransportParametersConsumer consumer) Set consumer for quic_transport_parameters sent by the remote side. Consumer will receive a byte buffer containing the value of quic_transport_parameters extension sent by the remote endpoint.
| |
| setSSLParameters | back to summary |
|---|---|
| public void setSSLParameters(SSLParameters sslParameters) Sets the
| |
| setUseClientMode | back to summary |
|---|---|
| public void setUseClientMode(boolean mode) If
| |
| signRetryPacket | back to summary |
|---|---|
| public void signRetryPacket(QuicVersion version, ByteBuffer originalConnectionId, ByteBuffer packet, ByteBuffer output) throws ShortBufferException, QuicTransportException Sign the provided retry packet. Input buffer contains the retry packet payload. Integrity tag is stored in the output buffer.
| |
| tryMarkHandshakeDone | back to summary |
|---|---|
| public boolean tryMarkHandshakeDone() throws IllegalStateException Called to check if a
| |
| tryReceiveHandshakeDone | back to summary |
|---|---|
| public boolean tryReceiveHandshakeDone() throws IllegalStateException Called when HANDSHAKE_DONE message is received from the server. This
method will only be called for a
| |
| verifyRetryPacket | back to summary |
|---|---|
| public void verifyRetryPacket(QuicVersion version, ByteBuffer originalConnectionId, ByteBuffer packet) throws AEADBadTagException, QuicTransportException Verify the provided retry packet.
| |
| versionNegotiated | back to summary |
|---|---|
| public void versionNegotiated(QuicVersion quicVersion) Called when the client and the server, during the connection creation handshake, have settled on a Quic version to use for the connection. This can happen either due to an explicit version negotiation (as outlined in Quic RFC) or the server accepting the Quic version that the client chose in its first INITIAL packet. In either of those cases, this method will be called.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final QuicTLSEngine. | HANDSHAKE_CONFIRMED
Handshake is confirmed, as specified in section 4.1.2 of RFC-9001 |
| public static final QuicTLSEngine. | NEED_RECV_CRYPTO
Need to receive a CRYPTO frame |
| public static final QuicTLSEngine. | NEED_RECV_HANDSHAKE_DONE
Need to receive a HANDSHAKE_DONE frame from server to complete the handshake, but application data can be sent in this state (client only state). |
| public static final QuicTLSEngine. | NEED_SEND_CRYPTO
Need to send a CRYPTO frame |
| public static final QuicTLSEngine. | NEED_SEND_HANDSHAKE_DONE
Need to send a HANDSHAKE_DONE frame to complete the handshake, but application data can be sent in this state (server only state) |
| public static final QuicTLSEngine. | NEED_TASK
Need to execute a task |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static QuicTLSEngine. | |
| public static QuicTLSEngine. |
| HANDSHAKE_CONFIRMED | back to summary |
|---|---|
| public static final QuicTLSEngine. Handshake is confirmed, as specified in section 4.1.2 of RFC-9001 | |
| NEED_RECV_CRYPTO | back to summary |
|---|---|
| public static final QuicTLSEngine. Need to receive a CRYPTO frame | |
| NEED_RECV_HANDSHAKE_DONE | back to summary |
|---|---|
| public static final QuicTLSEngine. Need to receive a HANDSHAKE_DONE frame from server to complete the handshake, but application data can be sent in this state (client only state). | |
| NEED_SEND_CRYPTO | back to summary |
|---|---|
| public static final QuicTLSEngine. Need to send a CRYPTO frame | |
| NEED_SEND_HANDSHAKE_DONE | back to summary |
|---|---|
| public static final QuicTLSEngine. Need to send a HANDSHAKE_DONE frame to complete the handshake, but application data can be sent in this state (server only state) | |
| NEED_TASK | back to summary |
|---|---|
| public static final QuicTLSEngine. Need to execute a task | |
| HandshakeState | back to summary |
|---|---|
| private HandshakeState() | |
| valueOf | back to summary |
|---|---|
| public static QuicTLSEngine. | |
| values | back to summary |
|---|---|
| public static QuicTLSEngine. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final QuicTLSEngine. | |
| public static final QuicTLSEngine. | |
| public static final QuicTLSEngine. | |
| public static final QuicTLSEngine. | |
| public static final QuicTLSEngine. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static QuicTLSEngine. | |
| public static QuicTLSEngine. |
| HANDSHAKE | back to summary |
|---|---|
| public static final QuicTLSEngine. | |
| INITIAL | back to summary |
|---|---|
| public static final QuicTLSEngine. | |
| ONE_RTT | back to summary |
|---|---|
| public static final QuicTLSEngine. | |
| RETRY | back to summary |
|---|---|
| public static final QuicTLSEngine. | |
| ZERO_RTT | back to summary |
|---|---|
| public static final QuicTLSEngine. | |
| KeySpace | back to summary |
|---|---|
| private KeySpace() | |
| valueOf | back to summary |
|---|---|
| public static QuicTLSEngine. | |
| values | back to summary |
|---|---|
| public static QuicTLSEngine. | |