Module jcifs

Class NtlmContext

java.lang.Object
org.codelibs.jcifs.smb1.NtlmContext

public class NtlmContext extends Object
For initiating NTLM authentication (including NTLMv2). If you want to add NTLMv2 authentication support to something this is what you want to use. See the code for details. Note that JCIFS does not implement the acceptor side of NTLM authentication.
  • Constructor Details

    • NtlmContext

      public NtlmContext(NtlmPasswordAuthentication auth, boolean doSigning)
      Creates a new NTLM context for SMB1 authentication.
      Parameters:
      auth - the NTLM authentication credentials
      doSigning - whether to enable message signing
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isEstablished

      public boolean isEstablished()
      Checks whether the security context is established.
      Returns:
      true if the context is established, false otherwise
    • getServerChallenge

      public byte[] getServerChallenge()
      Gets the server's NTLM challenge bytes.
      Returns:
      the server challenge bytes
    • getSigningKey

      public byte[] getSigningKey()
      Gets the signing key for message authentication.
      Returns:
      the signing key bytes
    • getNetbiosName

      public String getNetbiosName()
      Gets the NetBIOS name of the remote server.
      Returns:
      the NetBIOS name
    • initSecContext

      public byte[] initSecContext(byte[] token, int offset, int len) throws SmbException
      Initializes the security context with the given token.
      Parameters:
      token - the input token bytes
      offset - offset into the token array
      len - length of token data
      Returns:
      the output token bytes
      Throws:
      SmbException - if an error occurs during context initialization