Represents an NTLMSSP Type-3 message.
Type3Message
public Type3Message()
Creates a Type-3 message using default values from the current
environment.
Type3Message
public Type3Message(byte[] material)
throws IOException
Creates a Type-3 message using the given raw Type-3 material.
material
- The raw Type-3 material used to construct this message.
Type3Message
public Type3Message(int flags,
byte[] lmResponse,
byte[] ntResponse,
String domain,
String user,
String workstation)
Creates a Type-3 message with the specified parameters.
flags
- The flags to apply to this message.lmResponse
- The LanManager/LMv2 response.ntResponse
- The NT/NTLMv2 response.domain
- The domain in which the user has an account.user
- The username for the authenticating user.workstation
- The workstation from which authentication is
taking place.
Type3Message
public Type3Message(Type2Message type2)
Creates a Type-3 message in response to the given Type-2 message
using default values from the current environment.
type2
- The Type-2 message which this represents a response to.
Type3Message
public Type3Message(Type2Message type2,
String password,
String domain,
String user,
String workstation)
Creates a Type-3 message in response to the given Type-2 message.
type2
- The Type-2 message which this represents a response to.password
- The password to use when constructing the response.domain
- The domain in which the user has an account.user
- The username for the authenticating user.workstation
- The workstation from which authentication is
taking place.
getDefaultDomain
public static String getDefaultDomain()
Returns the default domain from the current environment.
getDefaultFlags
public static int getDefaultFlags()
Returns the default flags for a generic Type-3 message in the
current environment.
- An
int
containing the default flags.
getDefaultFlags
public static int getDefaultFlags(Type2Message type2)
Returns the default flags for a Type-3 message created in response
to the given Type-2 message in the current environment.
- An
int
containing the default flags.
getDefaultPassword
public static String getDefaultPassword()
Returns the default password from the current environment.
getDefaultUser
public static String getDefaultUser()
Returns the default user from the current environment.
getDefaultWorkstation
public static String getDefaultWorkstation()
Returns the default workstation from the current environment.
getDomain
public String getDomain()
Returns the domain in which the user has an account.
- A
String
containing the domain for the user.
getLMResponse
public byte[] getLMResponse()
Returns the LanManager/LMv2 response.
- A
byte[]
containing the LanManager response.
getLMResponse
public static byte[] getLMResponse(Type2Message type2,
String password)
Constructs the LanManager response to the given Type-2 message using
the supplied password.
type2
- The Type-2 message.password
- The password.
- A
byte[]
containing the LanManager response.
getLMv2Response
public static byte[] getLMv2Response(Type2Message type2,
String domain,
String user,
String password,
byte[] clientChallenge)
getNTResponse
public byte[] getNTResponse()
Returns the NT/NTLMv2 response.
- A
byte[]
containing the NT/NTLMv2 response.
getNTResponse
public static byte[] getNTResponse(Type2Message type2,
String password)
Constructs the NT response to the given Type-2 message using
the supplied password.
type2
- The Type-2 message.password
- The password.
- A
byte[]
containing the NT response.
getSessionKey
public byte[] getSessionKey()
Returns the session key.
- A
byte[]
containing the session key.
getUser
public String getUser()
Returns the username for the authenticating user.
- A
String
containing the user for this message.
getWorkstation
public String getWorkstation()
Returns the workstation from which authentication is being performed.
- A
String
containing the workstation.
setDomain
public void setDomain(String domain)
Sets the domain for this message.
setLMResponse
public void setLMResponse(byte[] lmResponse)
Sets the LanManager/LMv2 response for this message.
lmResponse
- The LanManager response.
setNTResponse
public void setNTResponse(byte[] ntResponse)
Sets the NT/NTLMv2 response for this message.
ntResponse
- The NT/NTLMv2 response.
setSessionKey
public void setSessionKey(byte[] sessionKey)
Sets the session key.
sessionKey
- The session key.
setUser
public void setUser(String user)
Sets the user for this message.
setWorkstation
public void setWorkstation(String workstation)
Sets the workstation for this message.
workstation
- The workstation.
toString
public String toString()