Package org.drasyl.node.handler.crypto
Class PFSArmHandler
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.PFSArmHandler
- 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. Does key-exchange with ephemeral keys to achieve PFS.
-
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, identity, peerIdentity, session
-
Constructor Summary
ModifierConstructorDescriptionPFSArmHandler
(Crypto crypto, Duration expireAfter, Duration retryInterval, int maxAgreements, Identity identity, IdentityPublicKey peerIdentity) protected
PFSArmHandler
(Crypto crypto, Identity identity, IdentityPublicKey peerIdentity, Session session, LongSupplier expireProvider, Duration retryInterval, PFSArmHandler.State state) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected 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, unarm
Methods inherited from class io.netty.handler.codec.MessageToMessageCodec
acceptInboundMessage, acceptOutboundMessage, channelRead, 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, channelReadComplete, 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
-
PFSArmHandler
protected PFSArmHandler(Crypto crypto, Identity identity, IdentityPublicKey peerIdentity, Session session, LongSupplier expireProvider, Duration retryInterval, PFSArmHandler.State state) -
PFSArmHandler
public PFSArmHandler(Crypto crypto, Duration expireAfter, Duration retryInterval, int maxAgreements, Identity identity, IdentityPublicKey peerIdentity) throws CryptoException - Throws:
CryptoException
-
-
Method Details
-
encode
protected void encode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf msg, List<Object> out) throws Exception - Overrides:
encode
in classAbstractArmHandler
- Throws:
Exception
-
decode
protected void decode(io.netty.channel.ChannelHandlerContext ctx, ArmHeader msg, List<Object> out) throws Exception - Overrides:
decode
in classAbstractArmHandler
- Throws:
Exception
-
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
-