APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.security.ntlm

pack-priv Class NTLM

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.security.ntlm.Server, com.sun.security.ntlm.Client
Static Imports
com.sun.security.ntlm.Version.*

NTLM authentication implemented according to MS-NLMP, version 12.1
Since
1.7

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
NTLM.Reader

Reading an NTLM packet

pack-priv static class
NTLM.Writer

Writing an NTLM packet

Field Summary

Modifier and TypeField and Description
private final Cipher
private static final boolean
private final SecretKeyFactory
private final Mac
private final MessageDigest
private final MessageDigest
pack-priv final Version
v

pack-priv final boolean
pack-priv final boolean

Constructor Summary

AccessConstructor and Description
protected
NTLM(String version)

Method Summary

Modifier and TypeMethod and Description
pack-priv byte[]
calcLMHash(byte[] pwb)

pack-priv byte[]
calcNTHash(byte[] pw)

pack-priv byte[]
calcResponse(byte[] key, byte[] text)

pack-priv byte[]
calcV2(byte[] nthash, String text, byte[] blob, byte[] challenge)

public void
debug(String
a format string
format
,
Object...
the arguments referenced by format
args
)

Prints out a formatted string, called in various places inside then NTLM implementation for debugging/logging purposes.

public void
debug(byte[]
the byte array to print out
bytes
)

Prints out the content of a byte array, called in various places inside the NTLM implementation for debugging/logging purposes.

pack-priv static byte[]
getP1(char[] password)

pack-priv static byte[]
getP2(char[] password)

pack-priv byte[]
hmacMD5(byte[] key, byte[] text)

pack-priv byte[]
makeDesKey(byte[] input, int off)

pack-priv static byte[]
ntlm2LM(byte[] nonce)

pack-priv byte[]
ntlm2NTLM(byte[] ntlmHash, byte[] nonce, byte[] challenge)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cipherback to summary
private final Cipher cipher
DEBUGback to summary
private static final boolean DEBUG
facback to summary
private final SecretKeyFactory fac
hmacback to summary
private final Mac hmac
md4back to summary
private final MessageDigest md4
md5back to summary
private final MessageDigest md5
vback to summary
pack-priv final Version v
writeLMback to summary
pack-priv final boolean writeLM
writeNTLMback to summary
pack-priv final boolean writeNTLM

Constructor Detail

NTLMback to summary
protected NTLM(String version) throws NTLMException

Method Detail

calcLMHashback to summary
pack-priv byte[] calcLMHash(byte[] pwb)
calcNTHashback to summary
pack-priv byte[] calcNTHash(byte[] pw)
calcResponseback to summary
pack-priv byte[] calcResponse(byte[] key, byte[] text)
calcV2back to summary
pack-priv byte[] calcV2(byte[] nthash, String text, byte[] blob, byte[] challenge)
debugback to summary
public void debug(String format, Object... args)

Prints out a formatted string, called in various places inside then NTLM implementation for debugging/logging purposes. When the system property "ntlm.debug" is set, System.out.printf(format, args) is called. This method is designed to be overridden by child classes to match their own debugging/logging mechanisms.

Parameters
format:String

a format string

args:Object[]

the arguments referenced by format

See Also
java.io.PrintStream#printf(java.lang.String, java.lang.Object[])
debugback to summary
public void debug(byte[] bytes)

Prints out the content of a byte array, called in various places inside the NTLM implementation for debugging/logging purposes. When the system property "ntlm.debug" is set, the hexdump of the array is printed into System.out. This method is designed to be overridden by child classes to match their own debugging/logging mechanisms.

Parameters
bytes:byte[]

the byte array to print out

getP1back to summary
pack-priv static byte[] getP1(char[] password)
getP2back to summary
pack-priv static byte[] getP2(char[] password)
hmacMD5back to summary
pack-priv byte[] hmacMD5(byte[] key, byte[] text)
makeDesKeyback to summary
pack-priv byte[] makeDesKey(byte[] input, int off)
ntlm2LMback to summary
pack-priv static byte[] ntlm2LM(byte[] nonce)
ntlm2NTLMback to summary
pack-priv byte[] ntlm2NTLM(byte[] ntlmHash, byte[] nonce, byte[] challenge)
com.sun.security.ntlm back to summary

pack-priv Class NTLM.Reader

extends Object
Class Inheritance

Reading an NTLM packet

Field Summary

Modifier and TypeField and Description
private final byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
Reader(byte[] data)

Method Summary

Modifier and TypeMethod and Description
pack-priv byte[]
readBytes(int offset, int len)

pack-priv int
readInt(int offset)

pack-priv byte[]
readSecurityBuffer(int offset)

pack-priv String
readSecurityBuffer(int offset, boolean unicode)

pack-priv int
readShort(int offset)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

internalback to summary
private final byte[] internal

Constructor Detail

Readerback to summary
pack-priv Reader(byte[] data)

Method Detail

readBytesback to summary
pack-priv byte[] readBytes(int offset, int len) throws NTLMException
readIntback to summary
pack-priv int readInt(int offset) throws NTLMException
readSecurityBufferback to summary
pack-priv byte[] readSecurityBuffer(int offset) throws NTLMException
readSecurityBufferback to summary
pack-priv String readSecurityBuffer(int offset, boolean unicode) throws NTLMException
readShortback to summary
pack-priv int readShort(int offset) throws NTLMException
com.sun.security.ntlm back to summary

pack-priv Class NTLM.Writer

extends Object
Class Inheritance

Writing an NTLM packet

Field Summary

Modifier and TypeField and Description
private int
private byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
Writer(int
NEGOTIATE || CHALLENGE || AUTHENTICATE
type
,
int
the base length, without security buffers
len
)

Starts writing a NTLM packet

Method Summary

Modifier and TypeMethod and Description
pack-priv byte[]
pack-priv void
writeBytes(int offset, byte[] data)

pack-priv void
writeInt(int offset, int number)

pack-priv void
writeSecurityBuffer(int offset, byte[] data)

pack-priv void
writeSecurityBuffer(int offset, String str, boolean unicode)

pack-priv void
writeShort(int offset, int number)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentback to summary
private int current
internalback to summary
private byte[] internal

Constructor Detail

Writerback to summary
pack-priv Writer(int type, int len)

Starts writing a NTLM packet

Parameters
type:int

NEGOTIATE || CHALLENGE || AUTHENTICATE

len:int

the base length, without security buffers

Method Detail

getBytesback to summary
pack-priv byte[] getBytes()
writeBytesback to summary
pack-priv void writeBytes(int offset, byte[] data)
writeIntback to summary
pack-priv void writeInt(int offset, int number)
writeSecurityBufferback to summary
pack-priv void writeSecurityBuffer(int offset, byte[] data) throws NTLMException
writeSecurityBufferback to summary
pack-priv void writeSecurityBuffer(int offset, String str, boolean unicode) throws NTLMException
writeShortback to summary
pack-priv void writeShort(int offset, int number)