Package jcifs.smb
Class NtlmPasswordAuthentication
- java.lang.Object
-
- jcifs.smb.NtlmPasswordAuthenticator
-
- jcifs.smb.NtlmPasswordAuthentication
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Principal
,Credentials
,CredentialsInternal
@Deprecated public class NtlmPasswordAuthentication extends NtlmPasswordAuthenticator
Deprecated.useNtlmPasswordAuthenticator
insteadThis 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.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jcifs.smb.NtlmPasswordAuthenticator
NtlmPasswordAuthenticator.AuthenticationType
-
-
Constructor Summary
Constructors Constructor Description NtlmPasswordAuthentication(String domain, String username, byte[] challenge, byte[] ansiHash, byte[] unicodeHash)
Deprecated.Create an NtlmPasswordAuthentication object with raw password hashes.NtlmPasswordAuthentication(CIFSContext tc)
Deprecated.Construct anonymous credentialsNtlmPasswordAuthentication(CIFSContext tc, String userInfo)
Deprecated.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)
Deprecated.Create an NtlmPasswordAuthentication object from a domain, username, and password.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
areHashesExternal()
Deprecated.NtlmPasswordAuthentication
clone()
Deprecated.protected static void
cloneInternal(NtlmPasswordAuthentication to, NtlmPasswordAuthentication from)
Deprecated.boolean
equals(Object obj)
Deprecated.Compares two NtlmPasswordAuthentication objects for equality.byte[]
getAnsiHash(CIFSContext tc, byte[] chlng)
Deprecated.Computes the 24 byte ANSI password hash given the 8 byte server challenge.protected CIFSContext
getContext()
Deprecated.byte[]
getUnicodeHash(CIFSContext tc, byte[] chlng)
Deprecated.Computes the 24 byte Unicode password hash given the 8 byte server challenge.byte[]
getUserSessionKey(CIFSContext tc, byte[] chlng)
Deprecated.Returns the effective user session key.void
getUserSessionKey(CIFSContext tc, byte[] chlng, byte[] dest, int offset)
Deprecated.Calculates the effective user session key.-
Methods inherited from class jcifs.smb.NtlmPasswordAuthenticator
cloneInternal, createContext, getName, getNTHash, getPassword, getSigningKey, getSpecifiedUserDomain, getSubject, getUserDomain, getUsername, guessAuthenticationType, hashCode, isAnonymous, isGuest, isPreferredMech, refresh, toString, unwrap
-
-
-
-
Constructor Detail
-
NtlmPasswordAuthentication
public NtlmPasswordAuthentication(CIFSContext tc)
Deprecated.Construct anonymous credentials- Parameters:
tc
-
-
NtlmPasswordAuthentication
public NtlmPasswordAuthentication(CIFSContext tc, String userInfo)
Deprecated.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.- Parameters:
tc
-userInfo
-
-
NtlmPasswordAuthentication
public NtlmPasswordAuthentication(CIFSContext tc, String domain, String username, String password)
Deprecated.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.- Parameters:
tc
- context to usedomain
-username
-password
-
-
NtlmPasswordAuthentication
public NtlmPasswordAuthentication(String domain, String username, byte[] challenge, byte[] ansiHash, byte[] unicodeHash)
Deprecated.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.- Parameters:
domain
-username
-challenge
-ansiHash
-unicodeHash
-
-
-
Method Detail
-
getContext
protected CIFSContext getContext()
Deprecated.
-
clone
public NtlmPasswordAuthentication clone()
Deprecated.- Specified by:
clone
in interfaceCredentialsInternal
- Overrides:
clone
in classNtlmPasswordAuthenticator
- Returns:
- a copy of the credentials
-
cloneInternal
protected static void cloneInternal(NtlmPasswordAuthentication to, NtlmPasswordAuthentication from)
Deprecated.- Parameters:
to
-from
-
-
equals
public boolean equals(Object obj)
Deprecated.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 challenge would be required to compute and compare the password hashes but that it not available with this method.- Specified by:
equals
in interfacePrincipal
- Overrides:
equals
in classNtlmPasswordAuthenticator
- See Also:
Object.equals(java.lang.Object)
-
areHashesExternal
public boolean areHashesExternal()
Deprecated.- Returns:
- whether the hashes are externally supplied
-
getAnsiHash
public byte[] getAnsiHash(CIFSContext tc, byte[] chlng) throws GeneralSecurityException
Deprecated.Computes the 24 byte ANSI password hash given the 8 byte server challenge.- Overrides:
getAnsiHash
in classNtlmPasswordAuthenticator
- Returns:
- the hash for the given challenge
- Throws:
GeneralSecurityException
- See Also:
NtlmPasswordAuthenticator.getAnsiHash(jcifs.CIFSContext, byte[])
-
getUnicodeHash
public byte[] getUnicodeHash(CIFSContext tc, byte[] chlng) throws GeneralSecurityException
Deprecated.Computes the 24 byte Unicode password hash given the 8 byte server challenge.- Overrides:
getUnicodeHash
in classNtlmPasswordAuthenticator
- Returns:
- the hash for the given challenge
- Throws:
GeneralSecurityException
- See Also:
NtlmPasswordAuthenticator.getUnicodeHash(jcifs.CIFSContext, byte[])
-
getUserSessionKey
public byte[] getUserSessionKey(CIFSContext tc, byte[] chlng)
Deprecated.Returns the effective user session key.- Overrides:
getUserSessionKey
in classNtlmPasswordAuthenticator
chlng
- The server challenge.- Returns:
- A
byte[]
containing the effective user session key, used in SMB MAC signing and NTLMSSP signing and sealing. - See Also:
NtlmPasswordAuthenticator.getUserSessionKey(jcifs.CIFSContext, byte[])
-
getUserSessionKey
public void getUserSessionKey(CIFSContext tc, byte[] chlng, byte[] dest, int offset) throws SmbException
Deprecated.Calculates the effective user session key.- Overrides:
getUserSessionKey
in classNtlmPasswordAuthenticator
- Parameters:
tc
- context to usechlng
- The server challenge.dest
- The destination array in which the user session key will be placed.offset
- The offset in the destination array at which the session key will start.- Throws:
SmbException
- See Also:
NtlmPasswordAuthenticator.getUserSessionKey(jcifs.CIFSContext, byte[], byte[], int)
-
-