public class NtlmPasswordAuthenticator extends Object implements Principal, CredentialsInternal, Serializable
NtlmPasswordAuthentication this does not cause guest authentication
when the "guest" username is supplied. Use NtlmPasswordAuthenticator.AuthenticationType instead.| Modifier and Type | Class and Description |
|---|---|
static class |
NtlmPasswordAuthenticator.AuthenticationType
Authentication strategy
|
| Constructor and Description |
|---|
NtlmPasswordAuthenticator()
Construct anonymous credentials
|
NtlmPasswordAuthenticator(NtlmPasswordAuthenticator.AuthenticationType type) |
NtlmPasswordAuthenticator(String username,
String password)
Create username/password credentials
|
NtlmPasswordAuthenticator(String domain,
String username,
String password)
Create username/password credentials with specified domain
|
NtlmPasswordAuthenticator(String domain,
String username,
String password,
NtlmPasswordAuthenticator.AuthenticationType type)
Create username/password credentials with specified domain
|
| Modifier and Type | Method and Description |
|---|---|
NtlmPasswordAuthenticator |
clone() |
SSPContext |
createContext(CIFSContext tc,
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() |
boolean |
isPreferredMech(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism) |
void |
refresh() |
String |
toString()
Return the domain and username in the format:
domain\\username.
|
<T extends Credentials> |
unwrap(Class<T> t) |
public NtlmPasswordAuthenticator()
public NtlmPasswordAuthenticator(NtlmPasswordAuthenticator.AuthenticationType type)
public NtlmPasswordAuthenticator(String username, String password)
username - password - public NtlmPasswordAuthenticator(String domain, String username, String password)
domain - username - password - public NtlmPasswordAuthenticator(String domain, String username, String password, NtlmPasswordAuthenticator.AuthenticationType type)
domain - username - password - type - authentication typepublic <T extends Credentials> T unwrap(Class<T> t)
unwrap in interface Credentialspublic Subject getSubject()
getSubject in interface CredentialsInternalpublic void refresh()
throws CIFSException
refresh in interface CredentialsInternalCIFSExceptionpublic SSPContext createContext(CIFSContext tc, 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 NtlmPasswordAuthenticator 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 boolean equals(Object obj)
equals in interface Principalequals in class ObjectObject.equals(java.lang.Object)public int hashCode()
public String toString()
public boolean isAnonymous()
isAnonymous in interface Credentialspublic boolean isGuest()
isGuest in interface Credentialspublic boolean isPreferredMech(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism)
mechanism - 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.SmbExceptionCopyright © 2023. All rights reserved.