|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcifs.smb.NtlmPasswordAuthentication
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.
Constructor Summary | |
NtlmPasswordAuthentication(java.lang.String userInfo)
Create an NtlmPasswordAuthentication object from the userinfo component of an SMB URL like "domain;user:pass". |
|
NtlmPasswordAuthentication(java.lang.String domain,
java.lang.String username,
byte[] challenge,
byte[] ansiHash,
byte[] unicodeHash)
Create an NtlmPasswordAuthentication object with raw password hashes. |
|
NtlmPasswordAuthentication(java.lang.String domain,
java.lang.String username,
java.lang.String password)
Create an NtlmPasswordAuthentication object from a domain, username, and password. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Compares two NtlmPasswordAuthentication objects for equality. |
byte[] |
getAnsiHash(byte[] challenge)
Computes the 24 byte ANSI password hash given the 8 byte server challenge. |
java.lang.String |
getDomain()
Returns the domain. |
static byte[] |
getLMv2Response(java.lang.String domain,
java.lang.String user,
java.lang.String password,
byte[] challenge,
byte[] clientChallenge)
Creates the LMv2 response for the supplied information. |
java.lang.String |
getName()
Return the domain and username in the format: domain\\username. |
static byte[] |
getNTLMResponse(java.lang.String password,
byte[] challenge)
Generate the Unicode MD4 hash for the password associated with these credentials. |
java.lang.String |
getPassword()
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. |
static byte[] |
getPreNTLMResponse(java.lang.String password,
byte[] challenge)
Generate the ANSI DES hash for the password associated with these credentials. |
byte[] |
getUnicodeHash(byte[] challenge)
Computes the 24 byte Unicode password hash given the 8 byte server challenge. |
java.lang.String |
getUsername()
Returns the username. |
byte[] |
getUserSessionKey(byte[] challenge)
Returns the effective user session key. |
int |
hashCode()
Return the upcased username hash code. |
java.lang.String |
toString()
Return the domain and username in the format: domain\\username. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NtlmPasswordAuthentication(java.lang.String userInfo)
public NtlmPasswordAuthentication(java.lang.String domain, java.lang.String username, java.lang.String password)
public NtlmPasswordAuthentication(java.lang.String domain, java.lang.String username, byte[] challenge, byte[] ansiHash, byte[] unicodeHash)
Method Detail |
public static byte[] getPreNTLMResponse(java.lang.String password, byte[] challenge)
public static byte[] getNTLMResponse(java.lang.String password, byte[] challenge)
public static byte[] getLMv2Response(java.lang.String domain, java.lang.String user, java.lang.String password, byte[] challenge, byte[] clientChallenge)
domain
- The domain in which the username exists.user
- The username.password
- The user's password.challenge
- The server challenge.clientChallenge
- The client challenge (nonce).public java.lang.String getDomain()
public java.lang.String getUsername()
public java.lang.String getPassword()
public java.lang.String getName()
getName
in interface java.security.Principal
public byte[] getAnsiHash(byte[] challenge)
public byte[] getUnicodeHash(byte[] challenge)
public byte[] getUserSessionKey(byte[] challenge)
challenge
- The server challenge.
byte[]
containing the effective user session key,
used in SMB MAC signing and NTLMSSP signing and sealing.public boolean equals(java.lang.Object obj)
equals
in interface java.security.Principal
public int hashCode()
hashCode
in interface java.security.Principal
public java.lang.String toString()
toString
in interface java.security.Principal
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |