public class NtlmPasswordAuthentication extends Object implements Principal, SmbCredentials, Serializable
Read jCIFS Exceptions and NtlmAuthenticator for related information.
Constructor and Description |
---|
NtlmPasswordAuthentication(CIFSContext tc)
Construct anonymous credentials
|
NtlmPasswordAuthentication(CIFSContext tc,
String userInfo)
Create an NtlmPasswordAuthentication object from the userinfo
component of an SMB URL like "domain;user:pass".
|
NtlmPasswordAuthentication(CIFSContext tc,
String domain,
String username,
String password)
Create an NtlmPasswordAuthentication object from a
domain, username, and password.
|
NtlmPasswordAuthentication(String domain,
String username,
byte[] challenge,
byte[] ansiHash,
byte[] unicodeHash)
Create an NtlmPasswordAuthentication object with raw password
hashes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
areHashesExternal() |
NtlmPasswordAuthentication |
clone() |
SSPContext |
createContext(CIFSContext transportContext,
String host,
byte[] initialToken,
boolean doSigning) |
boolean |
equals(Object obj)
Compares two NtlmPasswordAuthentication objects for
equality.
|
byte[] |
getAnsiHash(CIFSContext tc,
byte[] chlng)
Computes the 24 byte ANSI password hash given the 8 byte server challenge.
|
String |
getName()
Return the domain and username in the format:
domain\\username.
|
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.
|
byte[] |
getSigningKey(CIFSContext tc,
byte[] chlng) |
String |
getSpecifiedUserDomain() |
Subject |
getSubject() |
byte[] |
getUnicodeHash(CIFSContext tc,
byte[] chlng)
Computes the 24 byte Unicode password hash given the 8 byte server challenge.
|
String |
getUserDomain()
Returns the domain.
|
String |
getUsername()
Returns the username.
|
byte[] |
getUserSessionKey(CIFSContext tc,
byte[] chlng)
Returns the effective user session key.
|
int |
hashCode()
Return the upcased username hash code.
|
boolean |
isAnonymous() |
boolean |
isGuest() |
String |
toString()
Return the domain and username in the format:
domain\\username.
|
public NtlmPasswordAuthentication(CIFSContext tc, String domain, String username, String password)
tc
- context to usedomain
- username
- password
- public NtlmPasswordAuthentication(String domain, String username, byte[] challenge, byte[] ansiHash, byte[] unicodeHash)
domain
- username
- challenge
- ansiHash
- unicodeHash
- public NtlmPasswordAuthentication(CIFSContext tc)
tc
- public NtlmPasswordAuthentication(CIFSContext tc, String userInfo)
tc
- userInfo
- public Subject getSubject()
getSubject
in interface SmbCredentials
SmbCredentials.getSubject()
public SSPContext createContext(CIFSContext transportContext, String host, byte[] initialToken, boolean doSigning) throws SmbException
createContext
in interface SmbCredentials
SmbException
SmbCredentials.createContext(jcifs.CIFSContext, java.lang.String, byte[], boolean)
public NtlmPasswordAuthentication clone()
clone
in interface SmbCredentials
clone
in class Object
public String getUserDomain()
getUserDomain
in interface SmbCredentials
public String getSpecifiedUserDomain()
public String getUsername()
public String getPassword()
public String getName()
public byte[] getAnsiHash(CIFSContext tc, byte[] chlng) throws GeneralSecurityException
tc
- chlng
- GeneralSecurityException
public byte[] getUnicodeHash(CIFSContext tc, byte[] chlng) throws GeneralSecurityException
tc
- chlng
- GeneralSecurityException
public byte[] getSigningKey(CIFSContext tc, byte[] chlng) throws SmbException, GeneralSecurityException
tc
- chlng
- SmbException
GeneralSecurityException
public byte[] getUserSessionKey(CIFSContext tc, byte[] chlng)
tc
- chlng
- The server challenge.byte[]
containing the effective user session key,
used in SMB MAC signing and NTLMSSP signing and sealing.public boolean equals(Object obj)
public int hashCode()
public String toString()
public boolean isAnonymous()
isAnonymous
in interface SmbCredentials
public boolean isGuest()
isGuest
in interface SmbCredentials
public boolean areHashesExternal()
Copyright © 2016. All rights reserved.