cgl.narada.util.ntlm
Class NTLMAuthen

java.lang.Object
  extended by cgl.narada.util.ntlm.NTLMAuthen

public class NTLMAuthen
extends Object

NTLM Authentication library. Requires a JCE library with MD4 and DES with no-padding ECB cipher

Version:
1.0

Constructor Summary
NTLMAuthen(String domain, String hostname, String username, String password)
          --------------------------------------------------------------------- By default uses the Cryptix libraries.
NTLMAuthen(String providerClassName, String domain, String hostname, String username, String password)
          --------------------------------------------------------------------- Specify a specific crypto provider.
 
Method Summary
 String generateNTLM1Header()
          ---------------------------------------------------------------------
 String generateNTLM3Header()
          --------------------------------------------------------------------- Generates the 3rd step in NTLM authentication.
 byte[] getNonce()
          ---------------------------------------------------------------------
 void parseNTLM2Nonce(String header)
          --------------------------------------------------------------------- Extract the nonce from a NTLM Type 2 message header in base 64 encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NTLMAuthen

public NTLMAuthen(String providerClassName,
                  String domain,
                  String hostname,
                  String username,
                  String password)
           throws Exception
--------------------------------------------------------------------- Specify a specific crypto provider.

Throws:
Exception

NTLMAuthen

public NTLMAuthen(String domain,
                  String hostname,
                  String username,
                  String password)
           throws Exception
--------------------------------------------------------------------- By default uses the Cryptix libraries.

Throws:
Exception
Method Detail

generateNTLM1Header

public String generateNTLM1Header()
                           throws IOException
---------------------------------------------------------------------

Returns:
The proxy authentication header for NTLM type 1 message. of the form "NTLM XXXXXXXXXXXXX"
Throws:
IOException - an error occurred during string generation.

parseNTLM2Nonce

public void parseNTLM2Nonce(String header)
                     throws IllegalArgumentException
--------------------------------------------------------------------- Extract the nonce from a NTLM Type 2 message header in base 64 encoding.

Parameters:
header - The string in form of "NTLM XXXXXXXXXXXXXXXX"
Throws:
IllegalArgumentException - If the header is not in the right format.

generateNTLM3Header

public String generateNTLM3Header()
                           throws IllegalStateException,
                                  IllegalArgumentException
--------------------------------------------------------------------- Generates the 3rd step in NTLM authentication. Requires that parseNTLM2Nonce() was called and nonce is non-null.

Returns:
"NTLM XXXXXXXXXX" where XXXX is the type 3 message in Base64.
Throws:
IllegalStateException - No nonce exists.
IllegalArgumentException - An error occurred while generation based on the initialization parameters.

getNonce

public byte[] getNonce()
---------------------------------------------------------------------



For comments and suggestions please send e-mail to The NaradaBrokering Project