java.lang.Object
org.codelibs.jcifs.smb1.NtlmContext
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 Summary
ConstructorsConstructorDescriptionNtlmContext(NtlmPasswordAuthentication auth, boolean doSigning) Creates a new NTLM context for SMB1 authentication. -
Method Summary
Modifier and TypeMethodDescriptionGets the NetBIOS name of the remote server.byte[]Gets the server's NTLM challenge bytes.byte[]Gets the signing key for message authentication.byte[]initSecContext(byte[] token, int offset, int len) Initializes the security context with the given token.booleanChecks whether the security context is established.toString()
-
Constructor Details
-
NtlmContext
Creates a new NTLM context for SMB1 authentication.- Parameters:
auth- the NTLM authentication credentialsdoSigning- whether to enable message signing
-
-
Method Details
-
toString
-
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
Gets the NetBIOS name of the remote server.- Returns:
- the NetBIOS name
-
initSecContext
Initializes the security context with the given token.- Parameters:
token- the input token bytesoffset- offset into the token arraylen- length of token data- Returns:
- the output token bytes
- Throws:
SmbException- if an error occurs during context initialization
-