Java Doc for NtlmPasswordAuthentication.java in  » Net » jCIFS » jcifs » smb » 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 » Net » jCIFS » jcifs.smb 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jcifs.smb.NtlmPasswordAuthentication

NtlmPasswordAuthentication
final public class NtlmPasswordAuthentication implements Principal,Serializable(Code)
This class stores and encrypts NTLM user credentials. The default credentials are retrieved from the jcifs.smb.client.domain, jcifs.smb.client.username, and jcifs.smb.client.password properties.

Read jCIFS Exceptions and NtlmAuthenticator for related information.



Field Summary
final static  StringBLANK
    
final static  NtlmPasswordAuthenticationDEFAULT
    
final static  StringDEFAULT_DOMAIN
    
final static  StringDEFAULT_PASSWORD
    
final static  NtlmPasswordAuthenticationGUEST
    
final static  NtlmPasswordAuthenticationNULL
    
 byte[]ansiHash
    
 byte[]challenge
    
 byte[]clientChallenge
    
 Stringdomain
    
 booleanhashesExternal
    
 Stringpassword
    
 byte[]unicodeHash
    
 Stringusername
    

Constructor Summary
public  NtlmPasswordAuthentication(String userInfo)
     Create an NtlmPasswordAuthentication object from the userinfo component of an SMB URL like "domain;user:pass".
public  NtlmPasswordAuthentication(String domain, String username, String password)
     Create an NtlmPasswordAuthentication object from a domain, username, and password.
public  NtlmPasswordAuthentication(String domain, String username, byte[] challenge, byte[] ansiHash, byte[] unicodeHash)
     Create an NtlmPasswordAuthentication object with raw password hashes.

Method Summary
public  booleanequals(Object obj)
     Compares two NtlmPasswordAuthentication objects for equality.
public  byte[]getAnsiHash(byte[] challenge)
     Computes the 24 byte ANSI password hash given the 8 byte server challenge.
public  StringgetDomain()
     Returns the domain.
public static  byte[]getLMv2Response(String domain, String user, String password, byte[] challenge, byte[] clientChallenge)
     Creates the LMv2 response for the supplied information.
Parameters:
  domain - The domain in which the username exists.
Parameters:
  user - The username.
Parameters:
  password - The user's password.
Parameters:
  challenge - The server challenge.
Parameters:
  clientChallenge - The client challenge (nonce).
public static  byte[]getNTLMResponse(String password, byte[] challenge)
     Generate the Unicode MD4 hash for the password associated with these credentials.
public  StringgetName()
     Return the domain and username in the format: domain\\username.
public  StringgetPassword()
     Returns the password in plain text or null if the raw password hashes were used to construct this NtlmPasswordAuthentication object which will be the case when NTLM HTTP Authentication is used.
public static  byte[]getPreNTLMResponse(String password, byte[] challenge)
     Generate the ANSI DES hash for the password associated with these credentials.
public  byte[]getUnicodeHash(byte[] challenge)
     Computes the 24 byte Unicode password hash given the 8 byte server challenge.
public  byte[]getUserSessionKey(byte[] challenge)
     Returns the effective user session key.
Parameters:
  challenge - The server challenge.
 voidgetUserSessionKey(byte[] challenge, byte[] dest, int offset)
     Calculates the effective user session key.
public  StringgetUsername()
     Returns the username.
public  inthashCode()
     Return the upcased username hash code.
public  StringtoString()
     Return the domain and username in the format: domain\\username.

Field Detail
BLANK
final static String BLANK(Code)



DEFAULT
final static NtlmPasswordAuthentication DEFAULT(Code)



DEFAULT_DOMAIN
final static String DEFAULT_DOMAIN(Code)



DEFAULT_PASSWORD
final static String DEFAULT_PASSWORD(Code)



GUEST
final static NtlmPasswordAuthentication GUEST(Code)



NULL
final static NtlmPasswordAuthentication NULL(Code)



ansiHash
byte[] ansiHash(Code)



challenge
byte[] challenge(Code)



clientChallenge
byte[] clientChallenge(Code)



domain
String domain(Code)



hashesExternal
boolean hashesExternal(Code)



password
String password(Code)



unicodeHash
byte[] unicodeHash(Code)



username
String username(Code)




Constructor Detail
NtlmPasswordAuthentication
public NtlmPasswordAuthentication(String userInfo)(Code)
Create an NtlmPasswordAuthentication object from the userinfo component of an SMB URL like "domain;user:pass". This constructor is used internally be jCIFS when parsing SMB URLs.



NtlmPasswordAuthentication
public NtlmPasswordAuthentication(String domain, String username, String password)(Code)
Create an NtlmPasswordAuthentication object from a domain, username, and password. Parameters that are null will be substituted with jcifs.smb.client.domain, jcifs.smb.client.username, jcifs.smb.client.password property values.



NtlmPasswordAuthentication
public NtlmPasswordAuthentication(String domain, String username, byte[] challenge, byte[] ansiHash, byte[] unicodeHash)(Code)
Create an NtlmPasswordAuthentication object with raw password hashes. This is used exclusively by the jcifs.http.NtlmSsp class which is in turn used by NTLM HTTP authentication functionality.




Method Detail
equals
public boolean equals(Object obj)(Code)
Compares two NtlmPasswordAuthentication objects for equality. Two NtlmPasswordAuthentication objects are equal if their caseless domain and username fields are equal and either both hashes are external and they are equal or both internally supplied passwords are equal. If one NtlmPasswordAuthentication object has external hashes (meaning negotiated via NTLM HTTP Authentication) and the other does not they will not be equal. This is technically not correct however the server 8 byte challage would be required to compute and compare the password hashes but that it not available with this method.



getAnsiHash
public byte[] getAnsiHash(byte[] challenge)(Code)
Computes the 24 byte ANSI password hash given the 8 byte server challenge.



getDomain
public String getDomain()(Code)
Returns the domain.



getLMv2Response
public static byte[] getLMv2Response(String domain, String user, String password, byte[] challenge, byte[] clientChallenge)(Code)
Creates the LMv2 response for the supplied information.
Parameters:
  domain - The domain in which the username exists.
Parameters:
  user - The username.
Parameters:
  password - The user's password.
Parameters:
  challenge - The server challenge.
Parameters:
  clientChallenge - The client challenge (nonce).



getNTLMResponse
public static byte[] getNTLMResponse(String password, byte[] challenge)(Code)
Generate the Unicode MD4 hash for the password associated with these credentials.



getName
public String getName()(Code)
Return the domain and username in the format: domain\\username. This is equivalent to toString().



getPassword
public String getPassword()(Code)
Returns the password in plain text or null if the raw password hashes were used to construct this NtlmPasswordAuthentication object which will be the case when NTLM HTTP Authentication is used. There is no way to retrieve a users password in plain text unless it is supplied by the user at runtime.



getPreNTLMResponse
public static byte[] getPreNTLMResponse(String password, byte[] challenge)(Code)
Generate the ANSI DES hash for the password associated with these credentials.



getUnicodeHash
public byte[] getUnicodeHash(byte[] challenge)(Code)
Computes the 24 byte Unicode password hash given the 8 byte server challenge.



getUserSessionKey
public byte[] getUserSessionKey(byte[] challenge)(Code)
Returns the effective user session key.
Parameters:
  challenge - The server challenge. A byte[] containing the effective user session key,used in SMB MAC signing and NTLMSSP signing and sealing.



getUserSessionKey
void getUserSessionKey(byte[] challenge, byte[] dest, int offset) throws Exception(Code)
Calculates the effective user session key.
Parameters:
  challenge - The server challenge.
Parameters:
  dest - The destination array in which the user session key will beplaced.
Parameters:
  offset - The offset in the destination array at which thesession key will start.



getUsername
public String getUsername()(Code)
Returns the username.



hashCode
public int hashCode()(Code)
Return the upcased username hash code.



toString
public String toString()(Code)
Return the domain and username in the format: domain\\username. This is equivalent to getName().



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.