Class NTLMEngineImpl.NTLMMessage

java.lang.Object
org.apache.hc.client5.http.impl.auth.NTLMEngineImpl.NTLMMessage
Direct Known Subclasses:
NTLMEngineImpl.Type1Message, NTLMEngineImpl.Type2Message, NTLMEngineImpl.Type3Message
Enclosing class:
NTLMEngineImpl

static class NTLMEngineImpl.NTLMMessage extends Object
NTLM message generation, base class
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) int
    The current output position
    (package private) byte[]
    The current response
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor to use when message contents are not yet known
    NTLMMessage(byte[] message, int expectedType)
    Constructor to use when message bytes are known
    NTLMMessage(String messageBody, int expectedType)
    Constructor taking a string
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    addByte(byte b)
    Adds the given byte to the response.
    (package private) void
    addBytes(byte[] bytes)
    Adds the given bytes to the response.
    (package private) void
    addULong(int value)
    Adds a ULong to the response
    (package private) void
    addUShort(int value)
    Adds a USHORT to the response
    (package private) void
     
    byte[]
     
    (package private) int
    Get the message length
    (package private) int
    Get the length of the signature and flags, so calculations can adjust offsets accordingly.
    Returns the response that has been generated after shrinking the array if required and base64 encodes the response.
    (package private) void
    prepareResponse(int maxlength, int messageType)
    Prepares the object to create a response of the given length.
    (package private) byte
    readByte(int position)
    Read a byte from a position within the message buffer
    (package private) void
    readBytes(byte[] buffer, int position)
    Read a bunch of bytes from a position in the message buffer
    (package private) byte[]
    readSecurityBuffer(int position)
    Read a security buffer from a position within the message buffer
    (package private) int
    readULong(int position)
    Read a ulong from a position within the message buffer
    (package private) int
    readUShort(int position)
    Read a ushort from a position within the message buffer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • messageContents

      byte[] messageContents
      The current response
    • currentOutputPosition

      int currentOutputPosition
      The current output position
  • Constructor Details

  • Method Details

    • getPreambleLength

      int getPreambleLength()
      Get the length of the signature and flags, so calculations can adjust offsets accordingly.
    • getMessageLength

      int getMessageLength()
      Get the message length
    • readByte

      byte readByte(int position) throws NTLMEngineException
      Read a byte from a position within the message buffer
      Throws:
      NTLMEngineException
    • readBytes

      void readBytes(byte[] buffer, int position) throws NTLMEngineException
      Read a bunch of bytes from a position in the message buffer
      Throws:
      NTLMEngineException
    • readUShort

      int readUShort(int position)
      Read a ushort from a position within the message buffer
    • readULong

      int readULong(int position)
      Read a ulong from a position within the message buffer
    • readSecurityBuffer

      byte[] readSecurityBuffer(int position)
      Read a security buffer from a position within the message buffer
    • prepareResponse

      void prepareResponse(int maxlength, int messageType)
      Prepares the object to create a response of the given length.
      Parameters:
      maxlength - the maximum length of the response to prepare, including the type and the signature (which this method adds).
    • addByte

      void addByte(byte b)
      Adds the given byte to the response.
      Parameters:
      b - the byte to add.
    • addBytes

      void addBytes(byte[] bytes)
      Adds the given bytes to the response.
      Parameters:
      bytes - the bytes to add.
    • addUShort

      void addUShort(int value)
      Adds a USHORT to the response
    • addULong

      void addULong(int value)
      Adds a ULong to the response
    • getResponse

      public String getResponse()
      Returns the response that has been generated after shrinking the array if required and base64 encodes the response.
      Returns:
      The response as above.
    • getBytes

      public byte[] getBytes()
    • buildMessage

      void buildMessage()