|
Oracle Application Server HTTPClient Java API Reference 10g Release 3 (10.1.3.1.0) B32117-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
HTTPClient.ntlm.NtlmCore
The NtlmCore class implements the core functionality of the NTLM authentication protocol. This includes message formatting, message parsing, and cipher calculations.
NOTE: Currently supports LM and NTLM version 1, and does not support NTLM version 2.
Field Summary | |
static java.lang.String |
ASCII_CHARSET |
static java.lang.String |
MD4_CLASS_NAME Supported MD4 class, needed for NTLM version 1 response. |
static byte[] |
NTLMSSP_BYTES |
static java.lang.String |
OEM_CHARSET |
static java.lang.String |
UNICODE_CHARSET |
Constructor Summary | |
NtlmCore() |
Method Summary | |
static java.lang.String |
formatType1Message(java.lang.String clientHostName, java.lang.String clientHostDomain) Formats an NTLM Type 1 Message, containing the client host name and client host domain. |
static java.lang.String |
formatType3Message(java.lang.String clientHostName, java.lang.String userDomain, java.lang.String username, byte[] lmPasswordHash, byte[] ntlmPasswordHash, NtlmType2Message challenge) Formats an NTLM Type 3 Message, containing the client host name, user account domain, username, LM response, NTLM response. |
static byte[] |
generateLmV1Hash(java.lang.String password) Calculate the LM version 1 hash. |
static byte[] |
generateNtlmV1Hash(java.lang.String password) Creates the NTLM version 1 hash. |
static boolean |
isLmV1ResponseSupported() Determines whether the LM version 1 response is supported. |
static boolean |
isNtlmV1ResponseSupported() Determines whether the NTLM version 1 response is supported. |
static boolean |
isNtlmV2ResponseSupported() Determines whether the NTLM version 2 response is supported. |
static NtlmType2Message |
parseType2Message(java.lang.String messageStr) Parses an NTLM Type 2 Message, containing the server challenge and the server support flags. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String OEM_CHARSET
public static final java.lang.String UNICODE_CHARSET
public static final java.lang.String ASCII_CHARSET
public static final byte[] NTLMSSP_BYTES
public static final java.lang.String MD4_CLASS_NAME
Constructor Detail |
public NtlmCore()
Method Detail |
public static byte[] generateLmV1Hash(java.lang.String password) throws java.lang.Exception
password
- The given password.java.lang.Exception
- An error occurred.public static byte[] generateNtlmV1Hash(java.lang.String password) throws java.lang.Exception
password
- The given password.null
if NTLM is not supported.java.lang.Exception
- An error occurred.public static boolean isNtlmV1ResponseSupported()
Determines whether the NTLM version 1 response is supported.
<pTo support the NTLM version 1 response, the classcom.phaos.crypto.MD4
must be in the class path. This class is usually in the .jar file ojpse.jar
, available from Oracle.true
if NTLM version 1 response is supported, otherwise false
.public static boolean isNtlmV2ResponseSupported()
false
.true
if NTLM version 2 response is supported, otherwise false
.public static boolean isLmV1ResponseSupported()
true
.true
if LM version 1 response is supported, otherwise false
.public static java.lang.String formatType1Message(java.lang.String clientHostName, java.lang.String clientHostDomain)
Formats an NTLM Type 1 Message, containing the client host name and client host domain. This starts the NTLM handshake.
The returned value has already been Base 64 encoded, and may be appended to the Authorization header after the scheme token.
Currently supports LM and NTLM version 1, and does not support NTLM version 2.
NOTE: clientHostName and clientHostDomain are included as Type 1 message parameters for completeness, and are transmitted. However, the purpose of these parameters is to facilitate Local authentication, which is not currently supported by this package.
clientHostName
- Host name of client requesting protected resource, null
if none or not using Local authentication.clientHostDomain
- Domain name of which client host belongs, null
if none or not using Local authentication.public static NtlmType2Message parseType2Message(java.lang.String messageStr)
Parses an NTLM Type 2 Message, containing the server challenge and the server support flags.
messageStr
- The portion of the WWW-Authenticate or Proxy-Authenticate server response header, after the NTLM scheme token. This is assumed base-64 encoded.null
if a Type 2 message could not be determined. See log for error details.public static java.lang.String formatType3Message(java.lang.String clientHostName, java.lang.String userDomain, java.lang.String username, byte[] lmPasswordHash, byte[] ntlmPasswordHash, NtlmType2Message challenge)
Formats an NTLM Type 3 Message, containing the client host name, user account domain, username, LM response, NTLM response. Acceptance of this message by the server completes the NTLM handshake.
The returned value has already been Base 64 encoded, and may be appended to the Authorization header after the scheme token.
clientHostName
- Host name of the client requesting the protected resourceuserDomain
- Domain name of which the user account has membershipusername
- Credentials user namelmPasswordHash
- Credentials password as LM hash (See generateLmV1Hash(String)
)ntlmPasswordHash
- Credentials password as NTLM version 1 hash, null
if not available. (See generateNtlmV1Hash(String)
)challenge
- Challenge sent by the server in the type 2 message, used to generate the type 3 message.java.lang.IllegalArgumentException
- Invalid challenge given.
|
Oracle Application Server HTTPClient Java API Reference 10g Release 3 (10.1.3.1.0) B32117-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |