パッケージ jcifs.smb
クラス NtlmPasswordAuthenticator
- java.lang.Object
-
- jcifs.smb.NtlmPasswordAuthenticator
-
- すべての実装されたインタフェース:
Serializable,Cloneable,Principal,Credentials,CredentialsInternal
- 直系の既知のサブクラス:
Kerb5Authenticator,NtlmNtHashAuthenticator,NtlmPasswordAuthentication
public class NtlmPasswordAuthenticator extends Object implements Principal, CredentialsInternal, Serializable
This class stores and encrypts NTLM user credentials. Contrary toNtlmPasswordAuthenticationthis does not cause guest authentication when the "guest" username is supplied. UseNtlmPasswordAuthenticator.AuthenticationTypeinstead.- 作成者:
- mbechler
- 関連項目:
- 直列化された形式
-
-
ネストされたクラスの概要
ネストされたクラス 修飾子とタイプ クラス 説明 static classNtlmPasswordAuthenticator.AuthenticationTypeAuthentication strategy
-
コンストラクタの概要
コンストラクタ 修飾子 コンストラクタ 説明 NtlmPasswordAuthenticator()Construct anonymous credentialsNtlmPasswordAuthenticator(String username, String password)Create username/password credentialsNtlmPasswordAuthenticator(String domain, String username, String password)Create username/password credentials with specified domainprotectedNtlmPasswordAuthenticator(String userInfo, String defDomain, String defUser, String defPassword)protectedNtlmPasswordAuthenticator(String userInfo, String defDomain, String defUser, String defPassword, NtlmPasswordAuthenticator.AuthenticationType type)NtlmPasswordAuthenticator(String domain, String username, String password, NtlmPasswordAuthenticator.AuthenticationType type)Create username/password credentials with specified domainNtlmPasswordAuthenticator(NtlmPasswordAuthenticator.AuthenticationType type)
-
メソッドの概要
すべてのメソッド staticメソッド インスタンス・メソッド concreteメソッド 修飾子とタイプ メソッド 説明 NtlmPasswordAuthenticatorclone()protected static voidcloneInternal(NtlmPasswordAuthenticator cloned, NtlmPasswordAuthenticator toClone)SSPContextcreateContext(CIFSContext tc, String targetDomain, String host, byte[] initialToken, boolean doSigning)booleanequals(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.StringgetName()Return the domain and username in the format: domain\\username.protected byte[]getNTHash()StringgetPassword()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)StringgetSpecifiedUserDomain()SubjectgetSubject()byte[]getUnicodeHash(CIFSContext tc, byte[] chlng)Computes the 24 byte Unicode password hash given the 8 byte server challenge.StringgetUserDomain()Returns the domain.StringgetUsername()Returns the username.byte[]getUserSessionKey(CIFSContext tc, byte[] chlng)Returns the effective user session key.voidgetUserSessionKey(CIFSContext tc, byte[] chlng, byte[] dest, int offset)Calculates the effective user session key.protected NtlmPasswordAuthenticator.AuthenticationTypeguessAuthenticationType()inthashCode()Return the upcased username hash code.booleanisAnonymous()booleanisGuest()booleanisPreferredMech(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism)voidrefresh()StringtoString()Return the domain and username in the format: domain\\username.<T extends Credentials>
Tunwrap(Class<T> t)
-
-
-
コンストラクタの詳細
-
NtlmPasswordAuthenticator
public NtlmPasswordAuthenticator()
Construct anonymous credentials
-
NtlmPasswordAuthenticator
public NtlmPasswordAuthenticator(NtlmPasswordAuthenticator.AuthenticationType type)
-
NtlmPasswordAuthenticator
public NtlmPasswordAuthenticator(String username, String password)
Create username/password credentials- パラメータ:
username-password-
-
NtlmPasswordAuthenticator
public NtlmPasswordAuthenticator(String domain, String username, String password)
Create username/password credentials with specified domain- パラメータ:
domain-username-password-
-
NtlmPasswordAuthenticator
public NtlmPasswordAuthenticator(String domain, String username, String password, NtlmPasswordAuthenticator.AuthenticationType type)
Create username/password credentials with specified domain- パラメータ:
domain-username-password-type- authentication type
-
NtlmPasswordAuthenticator
protected NtlmPasswordAuthenticator(String userInfo, String defDomain, String defUser, String defPassword)
-
NtlmPasswordAuthenticator
protected NtlmPasswordAuthenticator(String userInfo, String defDomain, String defUser, String defPassword, NtlmPasswordAuthenticator.AuthenticationType type)
- パラメータ:
userInfo-
-
-
メソッドの詳細
-
guessAuthenticationType
protected NtlmPasswordAuthenticator.AuthenticationType guessAuthenticationType()
- 戻り値:
-
unwrap
public <T extends Credentials> T unwrap(Class<T> t)
- 定義:
unwrapインタフェース内Credentials- 戻り値:
- instance for type, null if the type cannot be unwrapped
-
getSubject
public Subject getSubject()
- 定義:
getSubjectインタフェース内CredentialsInternal- 戻り値:
- subject associated with the credentials
-
refresh
public void refresh() throws CIFSException- 定義:
refreshインタフェース内CredentialsInternal- 例外:
CIFSException
-
createContext
public SSPContext createContext(CIFSContext tc, String targetDomain, String host, byte[] initialToken, boolean doSigning) throws SmbException
- 定義:
createContextインタフェース内CredentialsInternal- 戻り値:
- a new context
- 例外:
SmbException- 関連項目:
CredentialsInternal.createContext(jcifs.CIFSContext, java.lang.String, java.lang.String, byte[], boolean)
-
clone
public NtlmPasswordAuthenticator clone()
- 定義:
cloneインタフェース内CredentialsInternal- オーバーライド:
cloneクラス内Object- 戻り値:
- a copy of the credentials
-
cloneInternal
protected static void cloneInternal(NtlmPasswordAuthenticator cloned, NtlmPasswordAuthenticator toClone)
-
getUserDomain
public String getUserDomain()
Returns the domain.- 定義:
getUserDomainインタフェース内Credentials- 戻り値:
- the domain the user account is in
-
getSpecifiedUserDomain
public String getSpecifiedUserDomain()
- 戻り値:
- the original specified user domain
-
getUsername
public String getUsername()
Returns the username.- 戻り値:
- the username
-
getPassword
public 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. There is no way to retrieve a users password in plain text unless it is supplied by the user at runtime.- 戻り値:
- the password
-
getName
public String getName()
Return the domain and username in the format: domain\\username. This is equivalent to toString().
-
equals
public boolean equals(Object obj)
Compares two NtlmPasswordAuthentication objects for equality. Two NtlmPasswordAuthentication objects are equal if their caseless domain and username fields are equal- 定義:
equalsインタフェース内Principal- オーバーライド:
equalsクラス内Object- 関連項目:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Return the upcased username hash code.
-
toString
public String toString()
Return the domain and username in the format: domain\\username. This is equivalent to getName().
-
isAnonymous
public boolean isAnonymous()
- 定義:
isAnonymousインタフェース内Credentials- 戻り値:
- whether these are anonymous credentials
-
isGuest
public boolean isGuest()
- 定義:
isGuestインタフェース内Credentials- 戻り値:
- whether these are guest credentials
-
isPreferredMech
public boolean isPreferredMech(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism)
- パラメータ:
mechanism-- 戻り値:
- whether the given mechanism is the preferred one for this credential
-
getAnsiHash
public byte[] getAnsiHash(CIFSContext tc, byte[] chlng) throws GeneralSecurityException
Computes the 24 byte ANSI password hash given the 8 byte server challenge.- パラメータ:
tc-chlng-- 戻り値:
- the hash for the given challenge
- 例外:
GeneralSecurityException
-
getUnicodeHash
public byte[] getUnicodeHash(CIFSContext tc, byte[] chlng) throws GeneralSecurityException
Computes the 24 byte Unicode password hash given the 8 byte server challenge.- パラメータ:
tc-chlng-- 戻り値:
- the hash for the given challenge
- 例外:
GeneralSecurityException
-
getSigningKey
public byte[] getSigningKey(CIFSContext tc, byte[] chlng) throws SmbException, GeneralSecurityException
- パラメータ:
tc-chlng-- 戻り値:
- the signing key
- 例外:
SmbExceptionGeneralSecurityException
-
getUserSessionKey
public byte[] getUserSessionKey(CIFSContext tc, byte[] chlng)
Returns the effective user session key.- パラメータ:
tc-chlng- The server challenge.- 戻り値:
- A
byte[]containing the effective user session key, used in SMB MAC signing and NTLMSSP signing and sealing.
-
getUserSessionKey
public void getUserSessionKey(CIFSContext tc, byte[] chlng, byte[] dest, int offset) throws SmbException
Calculates the effective user session key.- パラメータ:
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.- 例外:
SmbException
-
getNTHash
protected byte[] getNTHash()
- 戻り値:
-
-