java.lang.Object
org.codelibs.jcifs.smb.impl.NtlmPasswordAuthenticator
org.codelibs.jcifs.smb.impl.NtlmPasswordAuthentication
- All Implemented Interfaces:
Serializable,Cloneable,Principal,Credentials,CredentialsInternal
Deprecated.
This class stores and encrypts NTLM user credentials. The default
credentials are retrieved from the
org.codelibs.jcifs.smb.impl.client.domain,
org.codelibs.jcifs.smb.impl.client.username, and org.codelibs.jcifs.smb.impl.client.password
properties.
Read jCIFS Exceptions and NtlmAuthenticator for related information.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.codelibs.jcifs.smb.impl.NtlmPasswordAuthenticator
NtlmPasswordAuthenticator.AuthenticationType -
Constructor Summary
ConstructorsConstructorDescriptionNtlmPasswordAuthentication(String domain, String username, byte[] challenge, byte[] ansiHash, byte[] unicodeHash) Deprecated.Create anNtlmPasswordAuthenticationobject with raw password hashes.Deprecated.Construct anonymous credentialsNtlmPasswordAuthentication(CIFSContext tc, String userInfo) Deprecated.Create anNtlmPasswordAuthenticationobject from the userinfo component of an SMB URL like "domain;user:pass".NtlmPasswordAuthentication(CIFSContext tc, String domain, String username, String password) Deprecated.Create anNtlmPasswordAuthenticationobject from a domain, username, and password. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Check whether the password hashes are externally supplied.clone()Deprecated.Create a copy of the credentials.protected static voidDeprecated.Clone internal fields from one NtlmPasswordAuthentication to another.booleanDeprecated.Compares twoNtlmPasswordAuthenticationobjects for equality.byte[]getAnsiHash(CIFSContext tc, byte[] chlng) Deprecated.Computes the 24 byte ANSI password hash given the 8 byte server challenge.protected CIFSContextDeprecated.Get the CIFS context associated with this authentication.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.voidgetUserSessionKey(CIFSContext tc, byte[] chlng, byte[] dest, int offset) Deprecated.Calculates the effective user session key.Methods inherited from class org.codelibs.jcifs.smb.impl.NtlmPasswordAuthenticator
cloneInternal, createContext, getName, getNTHash, getPassword, getSigningKey, getSpecifiedUserDomain, getSubject, getUserDomain, getUsername, guessAuthenticationType, hashCode, isAnonymous, isGuest, isPreferredMech, refresh, toString, unwrap
-
Constructor Details
-
NtlmPasswordAuthentication
Deprecated.Construct anonymous credentials- Parameters:
tc- the CIFS context to use
-
NtlmPasswordAuthentication
Deprecated.Create anNtlmPasswordAuthenticationobject 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- the CIFS context to useuserInfo- the user information string in the format "domain;user:pass"
-
NtlmPasswordAuthentication
Deprecated.Create anNtlmPasswordAuthenticationobject from a domain, username, and password. Parameters that arenullwill be substituted withorg.codelibs.jcifs.smb.impl.client.domain,org.codelibs.jcifs.smb.impl.client.username,org.codelibs.jcifs.smb.impl.client.passwordproperty values.- Parameters:
tc- context to usedomain- the authentication domainusername- the username to authenticate withpassword- the password to authenticate with
-
NtlmPasswordAuthentication
public NtlmPasswordAuthentication(String domain, String username, byte[] challenge, byte[] ansiHash, byte[] unicodeHash) Deprecated.Create anNtlmPasswordAuthenticationobject with raw password hashes. This is used exclusively by theorg.codelibs.jcifs.smb.http.NtlmSspclass which is in turn used by NTLM HTTP authentication functionality.- Parameters:
domain- the authentication domainusername- the username to authenticate withchallenge- the server challenge bytesansiHash- the ANSI password hashunicodeHash- the Unicode password hash
-
-
Method Details
-
getContext
Deprecated.Get the CIFS context associated with this authentication.- Returns:
- the CIFS context
-
clone
Deprecated.Description copied from interface:CredentialsInternalCreate a copy of the credentials.- Specified by:
clonein interfaceCredentialsInternal- Overrides:
clonein classNtlmPasswordAuthenticator- Returns:
- a copy of the credentials
-
cloneInternal
Deprecated.Clone internal fields from one NtlmPasswordAuthentication to another.- Parameters:
to- the target authentication object to copy tofrom- the source authentication object to copy from
-
equals
Deprecated.Compares twoNtlmPasswordAuthenticationobjects for equality. TwoNtlmPasswordAuthenticationobjects 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 oneNtlmPasswordAuthenticationobject 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:
equalsin interfacePrincipal- Overrides:
equalsin classNtlmPasswordAuthenticator- See Also:
-
areHashesExternal
public boolean areHashesExternal()Deprecated.Check whether the password hashes are externally supplied.- Returns:
- whether the hashes are externally supplied
-
getAnsiHash
Deprecated.Computes the 24 byte ANSI password hash given the 8 byte server challenge.- Overrides:
getAnsiHashin classNtlmPasswordAuthenticator- Parameters:
tc- the CIFS contextchlng- the server challenge- Returns:
- the hash for the given challenge
- Throws:
GeneralSecurityException- if a security error occurs- See Also:
-
getUnicodeHash
Deprecated.Computes the 24 byte Unicode password hash given the 8 byte server challenge.- Overrides:
getUnicodeHashin classNtlmPasswordAuthenticator- Parameters:
tc- the CIFS contextchlng- the server challenge- Returns:
- the hash for the given challenge
- Throws:
GeneralSecurityException- if a security error occurs- See Also:
-
getUserSessionKey
Deprecated.Returns the effective user session key.- Overrides:
getUserSessionKeyin classNtlmPasswordAuthenticator- Parameters:
tc- the CIFS contextchlng- The server challenge.- Returns:
- A
byte[]containing the effective user session key, used in SMB MAC signing and NTLMSSP signing and sealing. - See Also:
-
getUserSessionKey
public void getUserSessionKey(CIFSContext tc, byte[] chlng, byte[] dest, int offset) throws SmbException Deprecated.Calculates the effective user session key.- Overrides:
getUserSessionKeyin 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- if an SMB error occurs- See Also:
-
NtlmPasswordAuthenticatorinstead