code: @Override
    public TsiFrameProtector createFrameProtector(int maxFrameSize, ByteBufAllocator alloc) {
      Preconditions.checkState(!isInProgress(), "Handshake is not complete.");
  
      byte[] key = handshaker.getKey();
      Preconditions.checkState(key.length == AltsChannelCrypter.getKeyLength(), "Bad key length.");
  
      return new AltsTsiFrameProtector(maxFrameSize, new AltsChannelCrypter(key, isClient), alloc);
    }
docs: Creates a frame protector from a completed handshake. No other methods may be called after the
  frame protector is created.
  
  @param maxFrameSize the requested max frame size, the callee is free to ignore.
  @param alloc used for allocating ByteBufs.
  @return a new TsiFrameProtector.