java.lang.Object
org.codelibs.jcifs.smb1.ntlmssp.NtlmMessage
org.codelibs.jcifs.smb1.ntlmssp.Type2Message
- All Implemented Interfaces:
NtlmFlags
Represents an NTLMSSP Type-2 message.
-
Field Summary
Fields inherited from class org.codelibs.jcifs.smb1.ntlmssp.NtlmMessage
NTLMSSP_SIGNATURE, UNI_ENCODINGFields inherited from interface org.codelibs.jcifs.smb1.ntlmssp.NtlmFlags
NTLMSSP_NEGOTIATE_128, NTLMSSP_NEGOTIATE_56, NTLMSSP_NEGOTIATE_ALWAYS_SIGN, NTLMSSP_NEGOTIATE_DATAGRAM_STYLE, NTLMSSP_NEGOTIATE_KEY_EXCH, NTLMSSP_NEGOTIATE_LM_KEY, NTLMSSP_NEGOTIATE_LOCAL_CALL, NTLMSSP_NEGOTIATE_NETWARE, NTLMSSP_NEGOTIATE_NTLM, NTLMSSP_NEGOTIATE_NTLM2, NTLMSSP_NEGOTIATE_OEM, NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED, NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED, NTLMSSP_NEGOTIATE_SEAL, NTLMSSP_NEGOTIATE_SIGN, NTLMSSP_NEGOTIATE_TARGET_INFO, NTLMSSP_NEGOTIATE_UNICODE, NTLMSSP_REQUEST_ACCEPT_RESPONSE, NTLMSSP_REQUEST_INIT_RESPONSE, NTLMSSP_REQUEST_NON_NT_SESSION_KEY, NTLMSSP_REQUEST_TARGET, NTLMSSP_TARGET_TYPE_DOMAIN, NTLMSSP_TARGET_TYPE_SERVER, NTLMSSP_TARGET_TYPE_SHARE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a Type-2 message using default values from the current environment.Type2Message(byte[] material) Creates a Type-2 message using the given raw Type-2 material.Type2Message(int flags, byte[] challenge, String target) Creates a Type-2 message with the specified parameters.Type2Message(Type1Message type1) Creates a Type-2 message in response to the given Type-1 message using default values from the current environment.Type2Message(Type1Message type1, byte[] challenge, String target) Creates a Type-2 message in response to the given Type-1 message. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the challenge for this message.byte[]Returns the local security context.static StringReturns the default domain from the current environment.static intReturns the default flags for a generic Type-2 message in the current environment.static intgetDefaultFlags(Type1Message type1) Returns the default flags for a Type-2 message created in response to the given Type-1 message in the current environment.static byte[]Returns the default target information for Type-2 messages.Returns the authentication target.byte[]Returns the target information block.voidsetChallenge(byte[] challenge) Sets the challenge for this message.voidsetContext(byte[] context) Sets the local security context.voidSets the authentication target.voidsetTargetInformation(byte[] targetInformation) Sets the target information block.byte[]Returns the raw byte representation of this message.toString()Methods inherited from class org.codelibs.jcifs.smb1.ntlmssp.NtlmMessage
getFlag, getFlags, setFlag, setFlags
-
Constructor Details
-
Type2Message
public Type2Message()Creates a Type-2 message using default values from the current environment. -
Type2Message
Creates a Type-2 message in response to the given Type-1 message using default values from the current environment.- Parameters:
type1- The Type-1 message which this represents a response to.
-
Type2Message
Creates a Type-2 message in response to the given Type-1 message.- Parameters:
type1- The Type-1 message which this represents a response to.challenge- The challenge from the domain controller/server.target- The authentication target.
-
Type2Message
Creates a Type-2 message with the specified parameters.- Parameters:
flags- The flags to apply to this message.challenge- The challenge from the domain controller/server.target- The authentication target.
-
Type2Message
Creates a Type-2 message using the given raw Type-2 material.- Parameters:
material- The raw Type-2 material used to construct this message.- Throws:
IOException- If an error occurs while parsing the material.
-
-
Method Details
-
getChallenge
public byte[] getChallenge()Returns the challenge for this message.- Returns:
- A
byte[]containing the challenge.
-
setChallenge
public void setChallenge(byte[] challenge) Sets the challenge for this message.- Parameters:
challenge- The challenge from the domain controller/server.
-
getTarget
Returns the authentication target.- Returns:
- A
Stringcontaining the authentication target.
-
setTarget
Sets the authentication target.- Parameters:
target- The authentication target.
-
getTargetInformation
public byte[] getTargetInformation()Returns the target information block.- Returns:
- A
byte[]containing the target information block. The target information block is used by the client to create an NTLMv2 response.
-
setTargetInformation
public void setTargetInformation(byte[] targetInformation) Sets the target information block. The target information block is used by the client to create an NTLMv2 response.- Parameters:
targetInformation- The target information block.
-
getContext
public byte[] getContext()Returns the local security context.- Returns:
- A
byte[]containing the local security context. This is used by the client to negotiate local authentication.
-
setContext
public void setContext(byte[] context) Sets the local security context. This is used by the client to negotiate local authentication.- Parameters:
context- The local security context.
-
toByteArray
public byte[] toByteArray()Description copied from class:NtlmMessageReturns the raw byte representation of this message.- Specified by:
toByteArrayin classNtlmMessage- Returns:
- A
byte[]containing the raw message material.
-
toString
-
getDefaultFlags
public static int getDefaultFlags()Returns the default flags for a generic Type-2 message in the current environment.- Returns:
- An
intcontaining the default flags.
-
getDefaultFlags
Returns the default flags for a Type-2 message created in response to the given Type-1 message in the current environment.- Parameters:
type1- the Type-1 message to respond to- Returns:
- An
intcontaining the default flags.
-
getDefaultDomain
Returns the default domain from the current environment.- Returns:
- A
Stringcontaining the domain.
-
getDefaultTargetInformation
public static byte[] getDefaultTargetInformation()Returns the default target information for Type-2 messages.- Returns:
- the default target information as a byte array
-