Package org.drasyl.node.handler.crypto
Class LongTimeArmHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.netty.handler.codec.MessageToMessageCodec<ArmHeader,io.netty.buffer.ByteBuf>
org.drasyl.node.handler.crypto.AbstractArmHandler
org.drasyl.node.handler.crypto.LongTimeArmHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
Arms (encrypt) outbound and disarms (decrypt) inbound messages. Messages that could not be
(dis-)armed are dropped. Uses only long time keys.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Fields inherited from class org.drasyl.node.handler.crypto.AbstractArmHandler
crypto, peerIdentity, session
-
Constructor Summary
ModifierConstructorDescriptionLongTimeArmHandler
(Duration expireAfter, int maxAgreements, Identity identity, IdentityPublicKey peerIdentity) LongTimeArmHandler
(Crypto crypto, Duration expireAfter, int maxAgreements, Identity identity, IdentityPublicKey peerIdentity) protected
LongTimeArmHandler
(Crypto crypto, IdentityPublicKey peerIdentity, Session session) -
Method Summary
Modifier and TypeMethodDescriptionprotected Agreement
getAgreement
(AgreementId agreementId) protected void
inboundArmMessage
(io.netty.channel.ChannelHandlerContext ctx, Object msg) protected void
onNonAgreement
(io.netty.channel.ChannelHandlerContext ctx) protected void
removeStaleAgreement
(io.netty.channel.ChannelHandlerContext ctx, Agreement agreement) Methods inherited from class org.drasyl.node.handler.crypto.AbstractArmHandler
arm, decode, encode, unarm
Methods inherited from class io.netty.handler.codec.MessageToMessageCodec
acceptInboundMessage, acceptOutboundMessage, channelRead, channelReadComplete, write
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
LongTimeArmHandler
-
LongTimeArmHandler
public LongTimeArmHandler(Crypto crypto, Duration expireAfter, int maxAgreements, Identity identity, IdentityPublicKey peerIdentity) throws CryptoException - Throws:
CryptoException
-
LongTimeArmHandler
public LongTimeArmHandler(Duration expireAfter, int maxAgreements, Identity identity, IdentityPublicKey peerIdentity) throws CryptoException - Throws:
CryptoException
-
-
Method Details
-
inboundArmMessage
- Specified by:
inboundArmMessage
in classAbstractArmHandler
-
onNonAgreement
protected void onNonAgreement(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
onNonAgreement
in classAbstractArmHandler
-
removeStaleAgreement
protected void removeStaleAgreement(io.netty.channel.ChannelHandlerContext ctx, Agreement agreement) - Specified by:
removeStaleAgreement
in classAbstractArmHandler
-
getAgreement
- Specified by:
getAgreement
in classAbstractArmHandler
-