Class NettyTsiHandshaker

java.lang.Object
io.grpc.alts.internal.NettyTsiHandshaker

public final class NettyTsiHandshaker extends Object
A wrapper for a TsiHandshaker that accepts netty ByteBufs.
  • Field Details

  • Constructor Details

    • NettyTsiHandshaker

      public NettyTsiHandshaker(TsiHandshaker handshaker)
  • Method Details

    • getBytesToSendToPeer

      void getBytesToSendToPeer(io.netty.buffer.ByteBuf out) throws GeneralSecurityException
      Gets data that is ready to be sent to the to the remote peer. This should be called in a loop until no bytes are written to the output buffer.
      Parameters:
      out - the buffer to receive the bytes.
      Throws:
      GeneralSecurityException
    • processBytesFromPeer

      boolean processBytesFromPeer(io.netty.buffer.ByteBuf data) throws GeneralSecurityException
      Process handshake data received from the remote peer.
      Returns:
      true, if the handshake has all the data it needs to process and false, if the method must be called again to complete processing.
      Throws:
      GeneralSecurityException
    • isInProgress

      boolean isInProgress()
      Returns true if and only if the handshake is still in progress.
      Returns:
      true, if the handshake is still in progress, false otherwise.
    • extractPeer

      TsiPeer extractPeer() throws GeneralSecurityException
      Returns the peer extracted from a completed handshake.
      Returns:
      the extracted peer.
      Throws:
      GeneralSecurityException
    • extractPeerObject

      Object extractPeerObject() throws GeneralSecurityException
      Returns the peer extracted from a completed handshake.
      Returns:
      the extracted peer.
      Throws:
      GeneralSecurityException
    • createFrameProtector

      TsiFrameProtector createFrameProtector(int maxFrameSize, io.netty.buffer.ByteBufAllocator alloc)
      Creates a frame protector from a completed handshake. No other methods may be called after the frame protector is created.
      Parameters:
      maxFrameSize - the requested max frame size, the callee is free to ignore.
      Returns:
      a new TsiFrameProtector.
    • createFrameProtector

      TsiFrameProtector createFrameProtector(io.netty.buffer.ByteBufAllocator alloc)
      Creates a frame protector from a completed handshake. No other methods may be called after the frame protector is created.
      Returns:
      a new TsiFrameProtector.
    • close

      void close()