Class NTLMEngine.NTLMMessage
java.lang.Object
org.tmatesoft.svn.core.internal.io.dav.http.NTLMEngine.NTLMMessage
- Direct Known Subclasses:
NTLMEngine.Type1Message,NTLMEngine.Type2Message,NTLMEngine.Type3Message
- Enclosing class:
- NTLMEngine
static class NTLMEngine.NTLMMessage
extends java.lang.Object
NTLM message generation, base class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThe current output positionprivate byte[]The current response -
Constructor Summary
ConstructorsConstructorDescriptionConstructor to use when message contents are not yet knownNTLMMessage(java.lang.String messageBody, int expectedType) Constructor to use when message contents are known -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddByte(byte b) Adds the given byte to the response.protected voidaddBytes(byte[] bytes) Adds the given bytes to the response.protected voidaddULong(int value) Adds a ULong to the responseprotected voidaddUShort(int value) Adds a USHORT to the responseprotected intGet the message lengthprotected intGet the length of the signature and flags, so calculations can adjust offsets accordingly.(package private) java.lang.StringReturns the response that has been generated after shrinking the array if required and base64 encodes the response.protected voidprepareResponse(int maxlength, int messageType) Prepares the object to create a response of the given length.protected bytereadByte(int position) Read a byte from a position within the message bufferprotected voidreadBytes(byte[] buffer, int position) Read a bunch of bytes from a position in the message bufferprotected byte[]readSecurityBuffer(int position) Read a security buffer from a position within the message bufferprotected intreadULong(int position) Read a ulong from a position within the message bufferprotected intreadUShort(int position) Read a ushort from a position within the message bufferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
messageContents
private byte[] messageContentsThe current response -
currentOutputPosition
private int currentOutputPositionThe current output position
-
-
Constructor Details
-
NTLMMessage
NTLMMessage()Constructor to use when message contents are not yet known -
NTLMMessage
NTLMMessage(java.lang.String messageBody, int expectedType) throws NTLMEngineException Constructor to use when message contents are known- Throws:
NTLMEngineException
-
-
Method Details
-
getPreambleLength
protected int getPreambleLength()Get the length of the signature and flags, so calculations can adjust offsets accordingly. -
getMessageLength
protected int getMessageLength()Get the message length -
readByte
Read a byte from a position within the message buffer- Throws:
NTLMEngineException
-
readBytes
Read a bunch of bytes from a position in the message buffer- Throws:
NTLMEngineException
-
readUShort
Read a ushort from a position within the message buffer- Throws:
NTLMEngineException
-
readULong
Read a ulong from a position within the message buffer- Throws:
NTLMEngineException
-
readSecurityBuffer
Read a security buffer from a position within the message buffer- Throws:
NTLMEngineException
-
prepareResponse
protected void prepareResponse(int maxlength, int messageType) Prepares the object to create a response of the given length.- Parameters:
maxlength- the maximum length of the response to prepare, not including the type and the signature (which this method adds).
-
addByte
protected void addByte(byte b) Adds the given byte to the response.- Parameters:
b- the byte to add.
-
addBytes
protected void addBytes(byte[] bytes) Adds the given bytes to the response.- Parameters:
bytes- the bytes to add.
-
addUShort
protected void addUShort(int value) Adds a USHORT to the response -
addULong
protected void addULong(int value) Adds a ULong to the response -
getResponse
java.lang.String getResponse()Returns the response that has been generated after shrinking the array if required and base64 encodes the response.- Returns:
- The response as above.
-