public final class InsecureQuicTokenHandler extends java.lang.Object implements QuicTokenHandler
QuicTokenHandler
which only does basic token generation / validation without any
crypto.
This shouldn't be used in production.Modifier and Type | Field and Description |
---|---|
static InsecureQuicTokenHandler |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
int |
maxTokenLength()
Return the maximal token length.
|
int |
validateToken(io.netty.buffer.ByteBuf token,
java.net.InetSocketAddress address)
Validate the token and return the offset,
-1 is returned if the token is not valid. |
boolean |
writeToken(io.netty.buffer.ByteBuf out,
io.netty.buffer.ByteBuf dcid,
java.net.InetSocketAddress address)
Generate a new token for the given destination connection id and address.
|
public static final InsecureQuicTokenHandler INSTANCE
public boolean writeToken(io.netty.buffer.ByteBuf out, io.netty.buffer.ByteBuf dcid, java.net.InetSocketAddress address)
QuicTokenHandler
out
.
If no token should be generated and so no token validation should take place at all this method should return
false
.writeToken
in interface QuicTokenHandler
out
- ByteBuf
into which the token will be written.dcid
- the destination connection id.address
- the InetSocketAddress
of the sender.true
if a token was written and so validation should happen, false
otherwise.public int validateToken(io.netty.buffer.ByteBuf token, java.net.InetSocketAddress address)
QuicTokenHandler
-1
is returned if the token is not valid.validateToken
in interface QuicTokenHandler
token
- the ByteBuf
that contains the token. The ownership is not transferred.address
- the InetSocketAddress
of the sender.-1
if the token was not valid.public int maxTokenLength()
QuicTokenHandler
maxTokenLength
in interface QuicTokenHandler
Copyright © 2020-2024 The Netty Project. All Rights Reserved.