Package com.hierynomus.smbj.connection
Class ConnectionContext
- java.lang.Object
-
- com.hierynomus.smbj.connection.ConnectionContext
-
public class ConnectionContext extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private SMB3EncryptionCiphercipherIdprivate java.util.EnumSet<SMB2GlobalCapability>clientCapabilitiesprivate java.util.UUIDclientGuidprivate intclientSecurityModeprivate java.util.Set<SMB3CompressionAlgorithm>compressionIdsprivate byte[]gssNegotiateTokenprivate NegotiatedProtocolnegotiatedProtocolprivate java.lang.StringnetBiosNameprivate SMB3HashAlgorithmpreauthIntegrityHashIdprivate byte[]preauthIntegrityHashValueprivate Serverserverprivate static intSIGNING_ENABLEDprivate static intSIGNING_REQUIREDprivate java.lang.LongtimeOffsetMillisprivate WindowsVersionwindowsVersion
-
Constructor Summary
Constructors Constructor Description ConnectionContext(java.util.UUID clientGuid, java.lang.String hostname, int port, SmbConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclientPrefersEncryption()Indicates that the client prefers encryption on this connection.SMB3EncryptionCiphergetCipherId()java.util.EnumSet<SMB2GlobalCapability>getClientCapabilities()java.util.UUIDgetClientGuid()java.util.Set<SMB3CompressionAlgorithm>getCompressionIds()byte[]getGssNegotiateToken()NegotiatedProtocolgetNegotiatedProtocol()java.lang.StringgetNetBiosName()SMB3HashAlgorithmgetPreauthIntegrityHashId()byte[]getPreauthIntegrityHashValue()ServergetServer()(package private) java.util.Set<SMB2GlobalCapability>getServerCapabilities()java.util.UUIDgetServerGuid()java.lang.StringgetServerName()(package private) intgetServerSecurityMode()java.lang.LonggetTimeOffsetMillis()WindowsVersiongetWindowsVersion()booleanisServerRequiresSigning()booleanisServerSigningEnabled()(package private) voidnegotiated(SMBProtocolNegotiator.NegotiationContext negotiationContext)voidsetNetBiosName(java.lang.String netBiosName)voidsetServer(Server server)voidsetWindowsVersion(WindowsVersion windowsVersion)private booleansupports(SMB2GlobalCapability capability)booleansupportsDFS()booleansupportsDirectoryLeasing()If Connection.Dialect belongs to the SMB 3.x dialect family, the client MUST perform the following: If SMB2_GLOBAL_CAP_DIRECTORY_LEASING is set in the Capabilities field of the SMB2 NEGOTIATE Response, the client MUST set Connection.SupportsDirectoryLeasing to TRUE.booleansupportsEncryption()booleansupportsFileLeasing()If the client implements SMB 2.1 or SMB 3.x dialect family, the client MUST perform the following: If SMB2_GLOBAL_CAP_LEASING is set in the Capabilities field of the SMB2 NEGOTIATE Response, the client MUST set Connection.SupportsFileLeasing to TRUE.booleansupportsMultiChannel()If Connection.Dialect belongs to the SMB 3.x dialect family, the client MUST perform the following: If SMB2_GLOBAL_CAP_MULTI_CHANNEL is set in the Capabilities field of the SMB2 NEGOTIATE Response, the client MUST set Connection.SupportsMultiChannel to TRUE.booleansupportsMultiCredit()If the client implements SMB 2.1 or SMB 3.x dialect family, the client MUST perform the following: If SMB2_GLOBAL_CAP_LARGE_MTU is set in the Capabilities field of the SMB2 NEGOTIATE Response, the client MUST set Connection.SupportsMultiCredit to TRUE.java.lang.StringtoString()
-
-
-
Field Detail
-
SIGNING_ENABLED
private static final int SIGNING_ENABLED
- See Also:
- Constant Field Values
-
SIGNING_REQUIRED
private static final int SIGNING_REQUIRED
- See Also:
- Constant Field Values
-
windowsVersion
private WindowsVersion windowsVersion
-
netBiosName
private java.lang.String netBiosName
-
gssNegotiateToken
private byte[] gssNegotiateToken
-
negotiatedProtocol
private NegotiatedProtocol negotiatedProtocol
-
server
private Server server
-
clientGuid
private final java.util.UUID clientGuid
-
clientCapabilities
private java.util.EnumSet<SMB2GlobalCapability> clientCapabilities
-
clientSecurityMode
private int clientSecurityMode
-
preauthIntegrityHashId
private SMB3HashAlgorithm preauthIntegrityHashId
-
preauthIntegrityHashValue
private byte[] preauthIntegrityHashValue
-
cipherId
private SMB3EncryptionCipher cipherId
-
compressionIds
private java.util.Set<SMB3CompressionAlgorithm> compressionIds
-
timeOffsetMillis
private java.lang.Long timeOffsetMillis
-
-
Constructor Detail
-
ConnectionContext
ConnectionContext(java.util.UUID clientGuid, java.lang.String hostname, int port, SmbConfig config)
-
-
Method Detail
-
negotiated
void negotiated(SMBProtocolNegotiator.NegotiationContext negotiationContext)
-
getClientGuid
public java.util.UUID getClientGuid()
-
isServerRequiresSigning
public boolean isServerRequiresSigning()
-
isServerSigningEnabled
public boolean isServerSigningEnabled()
-
getServerSecurityMode
int getServerSecurityMode()
-
getServerCapabilities
java.util.Set<SMB2GlobalCapability> getServerCapabilities()
-
getNegotiatedProtocol
public NegotiatedProtocol getNegotiatedProtocol()
-
getGssNegotiateToken
public byte[] getGssNegotiateToken()
-
getServerGuid
public java.util.UUID getServerGuid()
-
getServerName
public java.lang.String getServerName()
-
supports
private boolean supports(SMB2GlobalCapability capability)
-
getClientCapabilities
public java.util.EnumSet<SMB2GlobalCapability> getClientCapabilities()
-
getWindowsVersion
public WindowsVersion getWindowsVersion()
-
setWindowsVersion
public void setWindowsVersion(WindowsVersion windowsVersion)
-
getNetBiosName
public java.lang.String getNetBiosName()
-
setNetBiosName
public void setNetBiosName(java.lang.String netBiosName)
-
getCipherId
public SMB3EncryptionCipher getCipherId()
-
supportsEncryption
public boolean supportsEncryption()
-
clientPrefersEncryption
public boolean clientPrefersEncryption()
Indicates that the client prefers encryption on this connection. This will only be enabled if the established Session has an encryptionkey set.- Returns:
trueiff the negotiated protocol is at least SMB3 and both client and server have indicated they support encryption
-
supportsDFS
public boolean supportsDFS()
-
supportsFileLeasing
public boolean supportsFileLeasing()
If the client implements SMB 2.1 or SMB 3.x dialect family, the client MUST perform the following: If SMB2_GLOBAL_CAP_LEASING is set in the Capabilities field of the SMB2 NEGOTIATE Response, the client MUST set Connection.SupportsFileLeasing to TRUE. Otherwise, it MUST be set to FALSE.- Returns:
-
supportsMultiCredit
public boolean supportsMultiCredit()
If the client implements SMB 2.1 or SMB 3.x dialect family, the client MUST perform the following: If SMB2_GLOBAL_CAP_LARGE_MTU is set in the Capabilities field of the SMB2 NEGOTIATE Response, the client MUST set Connection.SupportsMultiCredit to TRUE. Otherwise, it MUST be set to FALSE.- Returns:
-
supportsDirectoryLeasing
public boolean supportsDirectoryLeasing()
If Connection.Dialect belongs to the SMB 3.x dialect family, the client MUST perform the following: If SMB2_GLOBAL_CAP_DIRECTORY_LEASING is set in the Capabilities field of the SMB2 NEGOTIATE Response, the client MUST set Connection.SupportsDirectoryLeasing to TRUE. Otherwise, it MUST be set to FALSE.- Returns:
-
supportsMultiChannel
public boolean supportsMultiChannel()
If Connection.Dialect belongs to the SMB 3.x dialect family, the client MUST perform the following: If SMB2_GLOBAL_CAP_MULTI_CHANNEL is set in the Capabilities field of the SMB2 NEGOTIATE Response, the client MUST set Connection.SupportsMultiChannel to TRUE. Otherwise, it MUST be set to FALSE.- Returns:
-
getTimeOffsetMillis
public java.lang.Long getTimeOffsetMillis()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getServer
public Server getServer()
-
setServer
public void setServer(Server server)
-
getPreauthIntegrityHashId
public SMB3HashAlgorithm getPreauthIntegrityHashId()
-
getPreauthIntegrityHashValue
public byte[] getPreauthIntegrityHashValue()
-
getCompressionIds
public java.util.Set<SMB3CompressionAlgorithm> getCompressionIds()
-
-