Class Encoder

java.lang.Object
net.schmizz.sshj.transport.Converter
net.schmizz.sshj.transport.Encoder

final class Encoder extends Converter
Encodes packets into the SSH binary protocol per the current algorithms.
  • Field Details

    • log

      private final org.slf4j.Logger log
    • prng

      private final Random prng
    • encodeLock

      private final Lock encodeLock
  • Constructor Details

  • Method Details

    • compress

      private void compress(SSHPacket buffer)
    • putMAC

      private void putMAC(SSHPacket buffer, int startOfPacket, int endOfPadding)
    • encode

      long encode(SSHPacket buffer)
      Encode a buffer into the SSH binary protocol per the current algorithms.
      Parameters:
      buffer - the buffer to encode
      Returns:
      the sequence no. of encoded packet
    • aeadOutgoingBuffer

      protected void aeadOutgoingBuffer(Buffer<?> buf, int offset, int len)
    • setAlgorithms

      void setAlgorithms(Cipher cipher, MAC mac, Compression compression)
      Overrides:
      setAlgorithms in class Converter
    • setAuthenticated

      void setAuthenticated()
      Overrides:
      setAuthenticated in class Converter
    • getCompressionType

      Compression.Mode getCompressionType()
      Specified by:
      getCompressionType in class Converter