java.lang.Object
org.codelibs.jcifs.smb.internal.smb2.nego.EncryptionNegotiateContext
- All Implemented Interfaces:
Decodable,Encodable,NegotiateContextRequest,NegotiateContextResponse
public class EncryptionNegotiateContext
extends Object
implements NegotiateContextRequest, NegotiateContextResponse
SMB2 Encryption Negotiate Context.
This negotiate context is used in SMB 3.x to negotiate
encryption capabilities and cipher suites.
- Author:
- mbechler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAES 128 CCMstatic final intAES 128 GCMstatic final intContext type -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for decoding.EncryptionNegotiateContext(Configuration config, int[] ciphers) Constructs an encryption negotiate context. -
Method Summary
Modifier and TypeMethodDescriptionintdecode(byte[] buffer, int bufferIndex, int len) Decode data from a byte bufferintencode(byte[] dst, int dstIndex) Encodes this object into the specified byte array.int[]Gets the supported encryption ciphers.intGets the negotiate context type.intsize()Returns the size in bytes that this object will occupy when encoded.
-
Field Details
-
NEGO_CTX_ENC_TYPE
public static final int NEGO_CTX_ENC_TYPEContext type- See Also:
-
CIPHER_AES128_CCM
public static final int CIPHER_AES128_CCMAES 128 CCM- See Also:
-
CIPHER_AES128_GCM
public static final int CIPHER_AES128_GCMAES 128 GCM- See Also:
-
-
Constructor Details
-
EncryptionNegotiateContext
Constructs an encryption negotiate context.- Parameters:
config- the configuration (currently unused)ciphers- array of encryption cipher IDs to negotiate
-
EncryptionNegotiateContext
public EncryptionNegotiateContext()Default constructor for decoding.
-
-
Method Details
-
getCiphers
public int[] getCiphers()Gets the supported encryption ciphers.- Returns:
- array of encryption cipher IDs
-
getContextType
public int getContextType()Gets the negotiate context type.- Specified by:
getContextTypein interfaceNegotiateContextRequest- Specified by:
getContextTypein interfaceNegotiateContextResponse- Returns:
- the SMB2 negotiate context type
- See Also:
-
encode
public int encode(byte[] dst, int dstIndex) Encodes this object into the specified byte array. -
decode
Decode data from a byte buffer- Specified by:
decodein interfaceDecodable- Parameters:
buffer- the byte buffer containing the data to decodebufferIndex- the starting index in the bufferlen- the maximum length of data to decode- Returns:
- decoded length
- Throws:
SMBProtocolDecodingException- if decoding fails- See Also:
-
size
public int size()Returns the size in bytes that this object will occupy when encoded.
-