public class NtlmPasswordAuthentication extends Object implements Principal, CredentialsInternal, 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 targetDomain,
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.
|
void |
getUserSessionKey(CIFSContext tc,
byte[] chlng,
byte[] dest,
int offset)
Calculates 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.
|
<T extends Credentials> |
unwrap(Class<T> type) |
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 <T extends Credentials> T unwrap(Class<T> type)
unwrap in interface Credentialspublic Subject getSubject()
getSubject in interface CredentialsInternalCredentialsInternal.getSubject()public SSPContext createContext(CIFSContext transportContext, String targetDomain, String host, byte[] initialToken, boolean doSigning) throws SmbException
createContext in interface CredentialsInternalSmbExceptionCredentialsInternal.createContext(jcifs.CIFSContext, java.lang.String, java.lang.String, byte[],
boolean)public NtlmPasswordAuthentication clone()
clone in interface CredentialsInternalclone in class Objectpublic String getUserDomain()
getUserDomain in interface Credentialspublic String getSpecifiedUserDomain()
public String getUsername()
public String getPassword()
public String getName()
public byte[] getAnsiHash(CIFSContext tc, byte[] chlng) throws GeneralSecurityException
tc - chlng - GeneralSecurityExceptionpublic byte[] getUnicodeHash(CIFSContext tc, byte[] chlng) throws GeneralSecurityException
tc - chlng - GeneralSecurityExceptionpublic byte[] getSigningKey(CIFSContext tc, byte[] chlng) throws SmbException, GeneralSecurityException
tc - chlng - SmbExceptionGeneralSecurityExceptionpublic 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 void getUserSessionKey(CIFSContext tc, byte[] chlng, byte[] dest, int offset) throws SmbException
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.SmbExceptionpublic boolean equals(Object obj)
public int hashCode()
public String toString()
public boolean isAnonymous()
isAnonymous in interface Credentialspublic boolean isGuest()
isGuest in interface Credentialspublic boolean areHashesExternal()
Copyright © 2018. All rights reserved.