|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.proxy.handlers.http.ntlm.NTLMUtilities
public class NTLMUtilities
NTLMUtilities.java - NTLM functions used for authentication and unit testing.
Field Summary |
---|
Constructor Summary | |
---|---|
NTLMUtilities()
|
Method Summary | |
---|---|
static byte[] |
createType1Message(String workStation,
String domain,
Integer customFlags,
byte[] osVersion)
see http://davenport.sourceforge.net/ntlm.html#theType1Message |
static byte[] |
createType3Message(String user,
String password,
byte[] challenge,
String target,
String workstation,
Integer serverFlags,
byte[] osVersion)
http://davenport.sourceforge.net/ntlm.html#theType3Message |
static byte[] |
extractChallengeFromType2Message(byte[] msg)
|
static int |
extractFlagsFromType2Message(byte[] msg)
|
static byte[] |
extractTargetInfoFromType2Message(byte[] msg,
Integer msgFlags)
|
static String |
extractTargetNameFromType2Message(byte[] msg,
Integer msgFlags)
|
static byte[] |
getOsVersion()
Tries to return a valid Os version on windows systems. |
static void |
printTargetInformationBlockFromType2Message(byte[] msg,
Integer msgFlags,
PrintWriter out)
|
static void |
writeOSVersion(byte majorVersion,
byte minorVersion,
short buildNumber,
byte[] b,
int offset)
|
static byte[] |
writeSecurityBuffer(short length,
int bufferOffset)
|
static void |
writeSecurityBuffer(short length,
short allocated,
int bufferOffset,
byte[] b,
int offset)
Writes a security buffer to the given array b at offset
offset . |
static int |
writeSecurityBufferAndUpdatePointer(ByteArrayOutputStream baos,
short len,
int pointer)
Write a security buffer and returns the pointer of the position where to write the next security buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NTLMUtilities()
Method Detail |
---|
public static final byte[] writeSecurityBuffer(short length, int bufferOffset)
writeSecurityBuffer(short, short, int, byte[], int)
public static final void writeSecurityBuffer(short length, short allocated, int bufferOffset, byte[] b, int offset)
b
at offset
offset
.
length
- the length of the security bufferallocated
- the allocated space for the security buffer (should be
greater or equal to length
bufferOffset
- the offset since the beginning of the b
buffer where the buffer iswrittenb
- the buffer in which we write the security bufferoffset
- the offset at which to write to the bufferpublic static final void writeOSVersion(byte majorVersion, byte minorVersion, short buildNumber, byte[] b, int offset)
public static final byte[] getOsVersion()
public static final byte[] createType1Message(String workStation, String domain, Integer customFlags, byte[] osVersion)
workStation
- the workstation namedomain
- the domain namecustomFlags
- custom flags, if null then
NTLMConstants.DEFAULT_CONSTANTS
is usedosVersion
- the os version of the client, if null then
NTLMConstants.DEFAULT_OS_VERSION
is used
public static final int writeSecurityBufferAndUpdatePointer(ByteArrayOutputStream baos, short len, int pointer) throws IOException
baos
- the stream where the security buffer is writtenlen
- the length of the security bufferpointer
- the position where the security buffer can be written
IOException
public static final byte[] extractChallengeFromType2Message(byte[] msg)
public static final int extractFlagsFromType2Message(byte[] msg)
public static final String extractTargetNameFromType2Message(byte[] msg, Integer msgFlags) throws UnsupportedEncodingException
UnsupportedEncodingException
public static final byte[] extractTargetInfoFromType2Message(byte[] msg, Integer msgFlags)
public static final void printTargetInformationBlockFromType2Message(byte[] msg, Integer msgFlags, PrintWriter out) throws UnsupportedEncodingException
UnsupportedEncodingException
public static final byte[] createType3Message(String user, String password, byte[] challenge, String target, String workstation, Integer serverFlags, byte[] osVersion)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |