パッケージ jcifs.smb
クラス NtlmPasswordAuthenticator
- java.lang.Object
-
- jcifs.smb.NtlmPasswordAuthenticator
-
- すべての実装されたインタフェース:
Serializable
,Cloneable
,Principal
,Credentials
,CredentialsInternal
- 直系の既知のサブクラス:
Kerb5Authenticator
,NtlmPasswordAuthentication
public class NtlmPasswordAuthenticator extends Object implements Principal, CredentialsInternal, Serializable
This class stores and encrypts NTLM user credentials.- 作成者:
- mbechler
- 関連項目:
- 直列化された形式
-
-
コンストラクタの概要
コンストラクタ 修飾子 コンストラクタ 説明 NtlmPasswordAuthenticator()
Construct anonymous credentialsNtlmPasswordAuthenticator(String username, String password)
Create username/password credentialsNtlmPasswordAuthenticator(String domain, String username, String password)
Create username/password credentials with specified domainprotected
NtlmPasswordAuthenticator(String userInfo, String defDomain, String defUser, String defPassword)
-
メソッドの概要
すべてのメソッド staticメソッド インスタンス・メソッド concreteメソッド 修飾子とタイプ メソッド 説明 NtlmPasswordAuthenticator
clone()
protected static void
cloneInternal(NtlmPasswordAuthenticator cloned, NtlmPasswordAuthenticator toClone)
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>
Tunwrap(Class<T> type)
-
-
-
コンストラクタの詳細
-
NtlmPasswordAuthenticator
public NtlmPasswordAuthenticator()
Construct anonymous credentials
-
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
-
-
-
メソッドの詳細
-
unwrap
public <T extends Credentials> T unwrap(Class<T> type)
- 定義:
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
- 例外:
SmbException
GeneralSecurityException
-
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
-
-