Class SignatureHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<I>
org.drasyl.peer.connection.handler.SimpleChannelDuplexHandler<Message,Message>
org.drasyl.peer.connection.handler.SignatureHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler

public class SignatureHandler extends SimpleChannelDuplexHandler<Message,Message>
Acts as a guard for in- and outbound messages.
Signs automatically outbound messages.
Validates automatically inbound messages and drops them, iff a signature is invalid or if a validation is impossible, e.g. the public key of the sender is unknown. In this case, drop information is written to the log.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SignatureHandler(int networkId, Identity identity)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    channelRead0(io.netty.channel.ChannelHandlerContext ctx, Message msg)
    Is called for each message of type SimpleChannelDuplexHandler on inbound channel.
    protected void
    channelWrite0(io.netty.channel.ChannelHandlerContext ctx, Message msg, io.netty.channel.ChannelPromise promise)
    Is called for each message of type SimpleChannelDuplexHandler on the outbound channel.

    Methods inherited from class org.drasyl.peer.connection.handler.SimpleChannelDuplexHandler

    acceptOutboundMessage, bind, close, connect, deregister, disconnect, flush, read, write

    Methods inherited from class io.netty.channel.SimpleChannelInboundHandler

    acceptInboundMessage, channelRead

    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