Java Doc for NTLMAuthorization.java in  » Web-Crawler » JoBo » net » matuschek » http » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Crawler » JoBo » net.matuschek.http 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.matuschek.http.NTLMAuthorization

NTLMAuthorization
public class NTLMAuthorization implements Serializable,Cloneable(Code)

This is an NTLM protocol authorization module for JOBO.

NTLM is a Microsoft proprietary network authentication protocol used in many situations and HTTPClient is a versatile and extendible component for implementing HTTP client applications.

This class relies on NTLM NTLM class. It also requires a JCE compliant library (e.g., Cryptix JCE) that implements MD4 and DES algorithms.

To perform an authentication the following information are needed:
  • the host name (with its own domain);
  • the user name (with its own domain);
  • the user password.
Alternatively, the user password can be replaced with its Lan Manager and NT hashed versions. On a Windows system these can be collected in the registry (with a bit of JNI, so), otherwise can be extracted from a SAMBA password file.
Notice that the host and user domain could not be the same.


author:
   Luigi Dragone (luigi@luigidragone.com)
author:
   oliver_schmidt
See Also:    NTLM Authentication Scheme for HTTP
See Also:    HTTPClient
See Also:    Hypertext Transfer Protocol -- HTTP/1.1
See Also:    HTTP Authentication: Basic and Digest Access Authentication
version:
   $Id: NTLMAuthorization.java,v 1.2 2003/05/23 17:00:00 oliver_schmidt
version:
   Exp $
version:
  


Inner Class :public class MissingJceException extends Exception

Field Summary
final public static  StringNTLM_TAG
    
final public static  StringPROXY_AUTHENTICATE_HEADER
    
final public static  StringWWW_AUTHENTICATE_HEADER
    
transient  byte[]nonce
    
final static  longserialVersionUID
    

Constructor Summary
public  NTLMAuthorization()
     Default constructor requires setting of attributes.
public  NTLMAuthorization(String host, String hostDomain, String user, String userDomain, byte[] lmPassword, byte[] ntPassword)
    

Build an NTLM authorization handler for the specified authentication credentials.

public  NTLMAuthorization(String host, String hostDomain, String user, String userDomain, String password)
    

Build an NTLM authorization handler for the specified authentication credentials.


Method Summary
final public  voidaddStandardSecurityProvider()
     Adds a standard security provider "cryptix.jce.
public  Objectclone()
    
public  voidextractNonce(String challenge)
    
public  StringgetDomain()
    
public  StringgetFilename()
    
public  StringgetHost()
    
public  StringgetHostDomain()
    
public  StringgetLmPassword()
    
public  byte[]getLmPasswordHash()
    
public  StringgetNtPassword()
    
public  byte[]getNtPasswordHash()
    
public  StringgetPassword()
    
public  StringgetRequest()
    
public  StringgetResponse()
    
public  StringgetSecurityProvider()
    
public  StringgetUser()
    
public  StringgetUserDomain()
    
public  booleanisComplete()
    
public static  voidmain(String[] args)
    
public static  NTLMAuthorizationreadFromFile(String filename)
    
public  voidsetDomain(String domain)
    
public  voidsetFilename(String filename)
    
public  voidsetHost(String host)
    
public  voidsetHostDomain(String hostDomain)
    
public  voidsetLmPassword(String password)
    
public  voidsetLmPasswordHash(byte[] password)
    
public  voidsetNtPassword(String password)
    
public  voidsetNtPasswordHash(byte[] password)
    
public  voidsetPassword(String password)
    
public  voidsetSecurityProvider(String securityProviderClassName)
    
public  voidsetUser(String user)
    
public  voidsetUserDomain(String userDomain)
    
public  StringtoString()
    
public  voidwriteToFile(String filename)
    

Field Detail
NTLM_TAG
final public static String NTLM_TAG(Code)



PROXY_AUTHENTICATE_HEADER
final public static String PROXY_AUTHENTICATE_HEADER(Code)



WWW_AUTHENTICATE_HEADER
final public static String WWW_AUTHENTICATE_HEADER(Code)



nonce
transient byte[] nonce(Code)



serialVersionUID
final static long serialVersionUID(Code)




Constructor Detail
NTLMAuthorization
public NTLMAuthorization()(Code)
Default constructor requires setting of attributes.



NTLMAuthorization
public NTLMAuthorization(String host, String hostDomain, String user, String userDomain, byte[] lmPassword, byte[] ntPassword)(Code)

Build an NTLM authorization handler for the specified authentication credentials.

All the arguments are mandatory (null value are not allowed).


Parameters:
  host - the name of the host that is authenticating
Parameters:
  hostDomain - the name of the domain to which the host belongs
Parameters:
  user - the name of the user
Parameters:
  userDomain - the name of the domain to which the user belongs
Parameters:
  lmPassword - a 16-bytes array containing the Lan Manager hashed password
Parameters:
  ntPassword - a 16-bytes array containing the NT hashed password
exception:
  IllegalArgumentException - if a supplied argument is invalid



NTLMAuthorization
public NTLMAuthorization(String host, String hostDomain, String user, String userDomain, String password) throws MissingJceException(Code)

Build an NTLM authorization handler for the specified authentication credentials.

All the arguments are mandatory (null value are not allowed).


Parameters:
  host - the name of the host that is authenticating
Parameters:
  hostDomain - the name of the domain to which the host belongs
Parameters:
  user - the name of the user
Parameters:
  userDomain - the name of the domain to which the user belongs
Parameters:
  password - the user's password
exception:
  IllegalArgumentException - if a supplied argument is invalid
exception:
  javax.crypto.NoSuchPaddingException - if there isn't any suitable padding method
exception:
  NoSuchAlgorithmException - if there isn't any suitable cipher algorithm




Method Detail
addStandardSecurityProvider
final public void addStandardSecurityProvider()(Code)
Adds a standard security provider "cryptix.jce. provider.CryptixCrypto".



clone
public Object clone()(Code)



extractNonce
public void extractNonce(String challenge) throws java.io.IOException(Code)



getDomain
public String getDomain()(Code)



getFilename
public String getFilename()(Code)



getHost
public String getHost()(Code)



getHostDomain
public String getHostDomain()(Code)



getLmPassword
public String getLmPassword()(Code)



getLmPasswordHash
public byte[] getLmPasswordHash()(Code)



getNtPassword
public String getNtPassword()(Code)



getNtPasswordHash
public byte[] getNtPasswordHash()(Code)



getPassword
public String getPassword()(Code)



getRequest
public String getRequest() throws IOException(Code)



getResponse
public String getResponse() throws MissingJceException(Code)



getSecurityProvider
public String getSecurityProvider()(Code)



getUser
public String getUser()(Code)



getUserDomain
public String getUserDomain()(Code)



isComplete
public boolean isComplete()(Code)



main
public static void main(String[] args)(Code)



readFromFile
public static NTLMAuthorization readFromFile(String filename) throws OptionalDataException, ClassNotFoundException, IOException(Code)



setDomain
public void setDomain(String domain)(Code)



setFilename
public void setFilename(String filename) throws OptionalDataException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException(Code)



setHost
public void setHost(String host)(Code)



setHostDomain
public void setHostDomain(String hostDomain)(Code)



setLmPassword
public void setLmPassword(String password) throws MissingJceException(Code)



setLmPasswordHash
public void setLmPasswordHash(byte[] password)(Code)



setNtPassword
public void setNtPassword(String password) throws MissingJceException(Code)



setNtPasswordHash
public void setNtPasswordHash(byte[] password)(Code)



setPassword
public void setPassword(String password) throws MissingJceException(Code)



setSecurityProvider
public void setSecurityProvider(String securityProviderClassName) throws ClassNotFoundException, InstantiationException, IllegalAccessException(Code)



setUser
public void setUser(String user)(Code)



setUserDomain
public void setUserDomain(String userDomain)(Code)



toString
public String toString()(Code)



writeToFile
public void writeToFile(String filename) throws FileNotFoundException, IOException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.