public class Type2Message extends NtlmMessage
NTLMSSP_NEGOTIATE_128, NTLMSSP_NEGOTIATE_56, NTLMSSP_NEGOTIATE_ALWAYS_SIGN, NTLMSSP_NEGOTIATE_ANONYMOUS, NTLMSSP_NEGOTIATE_DATAGRAM_STYLE, NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY, NTLMSSP_NEGOTIATE_KEY_EXCH, NTLMSSP_NEGOTIATE_LM_KEY, NTLMSSP_NEGOTIATE_LOCAL_CALL, NTLMSSP_NEGOTIATE_NETWARE, NTLMSSP_NEGOTIATE_NTLM, 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_NEGOTIATE_VERSION, 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 and Description |
|---|
Type2Message(byte[] material)
Creates a Type-2 message using the given raw Type-2 material.
|
Type2Message(CIFSContext tc)
Creates a Type-2 message using default values from the current
environment.
|
Type2Message(CIFSContext tc,
int flags,
byte[] challenge,
String target)
Creates a Type-2 message with the specified parameters.
|
Type2Message(CIFSContext tc,
Type1Message type1)
Creates a Type-2 message in response to the given Type-1 message
using default values from the current environment.
|
Type2Message(CIFSContext tc,
Type1Message type1,
byte[] challenge,
String target)
Creates a Type-2 message in response to the given Type-1 message.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getChallenge()
Returns the challenge for this message.
|
byte[] |
getContext()
Returns the local security context.
|
static int |
getDefaultFlags(CIFSContext tc)
Returns the default flags for a generic Type-2 message in the
current environment.
|
static int |
getDefaultFlags(CIFSContext tc,
Type1Message type1)
Returns the default flags for a Type-2 message created in response
to the given Type-1 message in the current environment.
|
String |
getTarget()
Returns the authentication target.
|
byte[] |
getTargetInformation()
Returns the target information block.
|
void |
setChallenge(byte[] challenge)
Sets the challenge for this message.
|
void |
setContext(byte[] context)
Sets the local security context.
|
void |
setTarget(String target)
Sets the authentication target.
|
void |
setTargetInformation(byte[] targetInformation)
Sets the target information block.
|
byte[] |
toByteArray()
Returns the raw byte representation of this message.
|
String |
toString() |
getFlag, getFlags, setFlag, setFlagspublic Type2Message(CIFSContext tc)
tc - context to usepublic Type2Message(CIFSContext tc, Type1Message type1)
tc - context to usetype1 - The Type-1 message which this represents a response to.public Type2Message(CIFSContext tc, Type1Message type1, byte[] challenge, String target)
tc - context to usetype1 - The Type-1 message which this represents a response to.challenge - The challenge from the domain controller/server.target - The authentication target.public Type2Message(CIFSContext tc, int flags, byte[] challenge, String target)
tc - context to useflags - The flags to apply to this message.challenge - The challenge from the domain controller/server.target - The authentication target.public Type2Message(byte[] material)
throws IOException
material - The raw Type-2 material used to construct this message.IOException - If an error occurs while parsing the material.public static int getDefaultFlags(CIFSContext tc)
tc - context to useint containing the default flags.public static int getDefaultFlags(CIFSContext tc, Type1Message type1)
tc - context to usetype1 - request messageint containing the default flags.public byte[] getChallenge()
byte[] containing the challenge.public void setChallenge(byte[] challenge)
challenge - The challenge from the domain controller/server.public String getTarget()
String containing the authentication target.public void setTarget(String target)
target - The authentication target.public byte[] getTargetInformation()
byte[] containing the target information block.
The target information block is used by the client to create an
NTLMv2 response.public void setTargetInformation(byte[] targetInformation)
targetInformation - The target information block.public byte[] getContext()
byte[] containing the local security
context. This is used by the client to negotiate local
authentication.public void setContext(byte[] context)
context - The local security context.public byte[] toByteArray()
throws IOException
NtlmMessagetoByteArray in class NtlmMessagebyte[] containing the raw message material.IOExceptionCopyright © 2023. All rights reserved.