Package io.netty.handler.codec.quic
Class InsecureQuicTokenHandler
- java.lang.Object
- 
- io.netty.handler.codec.quic.InsecureQuicTokenHandler
 
- 
- All Implemented Interfaces:
- QuicTokenHandler
 
 public final class InsecureQuicTokenHandler extends java.lang.Object implements QuicTokenHandler InsecureQuicTokenHandlerwhich only does basic token generation / validation without any crypto. This shouldn't be used in production.
- 
- 
Field SummaryFields Modifier and Type Field Description static InsecureQuicTokenHandlerINSTANCE
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intmaxTokenLength()Return the maximal token length.intvalidateToken(ByteBuf token, java.net.InetSocketAddress address)Validate the token and return the offset,-1is returned if the token is not valid.booleanwriteToken(ByteBuf out, ByteBuf dcid, java.net.InetSocketAddress address)Generate a new token for the given destination connection id and address.
 
- 
- 
- 
Field Detail- 
INSTANCEpublic static final InsecureQuicTokenHandler INSTANCE 
 
- 
 - 
Method Detail- 
writeTokenpublic boolean writeToken(ByteBuf out, ByteBuf dcid, java.net.InetSocketAddress address) Description copied from interface:QuicTokenHandlerGenerate a new token for the given destination connection id and address. This token is written toout. If no token should be generated and so no token validation should take place at all this method should returnfalse.- Specified by:
- writeTokenin interface- QuicTokenHandler
- Parameters:
- out-- ByteBufinto which the token will be written.
- dcid- the destination connection id. The- ByteBuf.readableBytes()will be at most- Quic.MAX_CONN_ID_LEN.
- address- the- InetSocketAddressof the sender.
- Returns:
- trueif a token was written and so validation should happen,- falseotherwise.
 
 - 
validateTokenpublic int validateToken(ByteBuf token, java.net.InetSocketAddress address) Description copied from interface:QuicTokenHandlerValidate the token and return the offset,-1is returned if the token is not valid.- Specified by:
- validateTokenin interface- QuicTokenHandler
- Parameters:
- token- the- ByteBufthat contains the token. The ownership is not transferred.
- address- the- InetSocketAddressof the sender.
- Returns:
- the start index after the token or -1if the token was not valid.
 
 - 
maxTokenLengthpublic int maxTokenLength() Description copied from interface:QuicTokenHandlerReturn the maximal token length.- Specified by:
- maxTokenLengthin interface- QuicTokenHandler
- Returns:
- the maximal supported token length.
 
 
- 
 
-