Module jcifs

Class SigningDigest

java.lang.Object
org.codelibs.jcifs.smb1.SigningDigest

public class SigningDigest extends Object
To filter 0 len updates and for debugging
  • Field Details

    • DEFAULT_PORT

      static final int DEFAULT_PORT
      Default SMB port number
      See Also:
    • DEFAULT_MAX_MPX_COUNT

      static final int DEFAULT_MAX_MPX_COUNT
      Default maximum multiplex count
      See Also:
    • DEFAULT_RESPONSE_TIMEOUT

      static final int DEFAULT_RESPONSE_TIMEOUT
      Default response timeout in milliseconds
      See Also:
    • DEFAULT_SO_TIMEOUT

      static final int DEFAULT_SO_TIMEOUT
      Default socket timeout in milliseconds
      See Also:
    • DEFAULT_RCV_BUF_SIZE

      static final int DEFAULT_RCV_BUF_SIZE
      Default receive buffer size in bytes
      See Also:
    • DEFAULT_SND_BUF_SIZE

      static final int DEFAULT_SND_BUF_SIZE
      Default send buffer size in bytes
      See Also:
    • DEFAULT_SSN_LIMIT

      static final int DEFAULT_SSN_LIMIT
      Default session limit
      See Also:
    • DEFAULT_CONN_TIMEOUT

      static final int DEFAULT_CONN_TIMEOUT
      Default connection timeout in milliseconds
      See Also:
    • LADDR

      static final InetAddress LADDR
      Local address to bind to
    • LPORT

      static final int LPORT
      Local port to bind to
    • MAX_MPX_COUNT

      static final int MAX_MPX_COUNT
      Maximum multiplex count
    • SND_BUF_SIZE

      static final int SND_BUF_SIZE
      Send buffer size in bytes
    • RCV_BUF_SIZE

      static final int RCV_BUF_SIZE
      Receive buffer size in bytes
    • USE_UNICODE

      static final boolean USE_UNICODE
      Whether to use Unicode strings
    • FORCE_UNICODE

      static final boolean FORCE_UNICODE
      Whether to force Unicode usage
    • USE_NTSTATUS

      static final boolean USE_NTSTATUS
      Whether to use NT status codes
    • SIGNPREF

      static final boolean SIGNPREF
      Whether signing is preferred
    • USE_NTSMBS

      static final boolean USE_NTSMBS
      Whether to use NT SMBs
    • USE_EXTSEC

      static final boolean USE_EXTSEC
      Whether to use extended security
    • NETBIOS_HOSTNAME

      static final String NETBIOS_HOSTNAME
      NetBIOS hostname
    • LM_COMPATIBILITY

      static final int LM_COMPATIBILITY
      LM compatibility level
    • FLAGS_NONE

      static final int FLAGS_NONE
      No flags set
      See Also:
    • FLAGS_LOCK_AND_READ_WRITE_AND_UNLOCK

      static final int FLAGS_LOCK_AND_READ_WRITE_AND_UNLOCK
      Lock and read write and unlock flag
      See Also:
    • FLAGS_RECEIVE_BUFFER_POSTED

      static final int FLAGS_RECEIVE_BUFFER_POSTED
      Receive buffer posted flag
      See Also:
    • FLAGS_PATH_NAMES_CASELESS

      static final int FLAGS_PATH_NAMES_CASELESS
      Path names are caseless flag
      See Also:
    • FLAGS_PATH_NAMES_CANONICALIZED

      static final int FLAGS_PATH_NAMES_CANONICALIZED
      Path names canonicalized flag
      See Also:
    • FLAGS_OPLOCK_REQUESTED_OR_GRANTED

      static final int FLAGS_OPLOCK_REQUESTED_OR_GRANTED
      Oplock requested or granted flag
      See Also:
    • FLAGS_NOTIFY_OF_MODIFY_ACTION

      static final int FLAGS_NOTIFY_OF_MODIFY_ACTION
      Notify of modify action flag
      See Also:
    • FLAGS_RESPONSE

      static final int FLAGS_RESPONSE
      Response flag
      See Also:
    • FLAGS2_NONE

      static final int FLAGS2_NONE
      No flags2 set
      See Also:
    • FLAGS2_LONG_FILENAMES

      static final int FLAGS2_LONG_FILENAMES
      Long filenames supported flag
      See Also:
    • FLAGS2_EXTENDED_ATTRIBUTES

      static final int FLAGS2_EXTENDED_ATTRIBUTES
      Extended attributes supported flag
      See Also:
    • FLAGS2_SECURITY_SIGNATURES

      static final int FLAGS2_SECURITY_SIGNATURES
      Security signatures supported flag
      See Also:
    • FLAGS2_EXTENDED_SECURITY_NEGOTIATION

      static final int FLAGS2_EXTENDED_SECURITY_NEGOTIATION
      Extended security negotiation flag
      See Also:
    • FLAGS2_RESOLVE_PATHS_IN_DFS

      static final int FLAGS2_RESOLVE_PATHS_IN_DFS
      Resolve paths in DFS flag
      See Also:
    • FLAGS2_PERMIT_READ_IF_EXECUTE_PERM

      static final int FLAGS2_PERMIT_READ_IF_EXECUTE_PERM
      Permit read if execute permission flag
      See Also:
    • FLAGS2_STATUS32

      static final int FLAGS2_STATUS32
      32-bit status codes flag
      See Also:
    • FLAGS2_UNICODE

      static final int FLAGS2_UNICODE
      Unicode strings flag
      See Also:
    • CAP_NONE

      static final int CAP_NONE
      No capabilities
      See Also:
    • CAP_RAW_MODE

      static final int CAP_RAW_MODE
      Raw mode capability
      See Also:
    • CAP_MPX_MODE

      static final int CAP_MPX_MODE
      MPX mode capability
      See Also:
    • CAP_UNICODE

      static final int CAP_UNICODE
      Unicode capability
      See Also:
    • CAP_LARGE_FILES

      static final int CAP_LARGE_FILES
      Large files capability
      See Also:
    • CAP_NT_SMBS

      static final int CAP_NT_SMBS
      NT SMBs capability
      See Also:
    • CAP_RPC_REMOTE_APIS

      static final int CAP_RPC_REMOTE_APIS
      RPC remote APIs capability
      See Also:
    • CAP_STATUS32

      static final int CAP_STATUS32
      32-bit status codes capability
      See Also:
    • CAP_LEVEL_II_OPLOCKS

      static final int CAP_LEVEL_II_OPLOCKS
      Level II oplocks capability
      See Also:
    • CAP_LOCK_AND_READ

      static final int CAP_LOCK_AND_READ
      Lock and read capability
      See Also:
    • CAP_NT_FIND

      static final int CAP_NT_FIND
      NT find capability
      See Also:
    • CAP_DFS

      static final int CAP_DFS
      DFS capability
      See Also:
    • CAP_EXTENDED_SECURITY

      static final int CAP_EXTENDED_SECURITY
      Extended security capability
      See Also:
    • ATTR_READONLY

      static final int ATTR_READONLY
      Read-only file attribute
      See Also:
    • ATTR_HIDDEN

      static final int ATTR_HIDDEN
      Hidden file attribute
      See Also:
    • ATTR_SYSTEM

      static final int ATTR_SYSTEM
      System file attribute
      See Also:
    • ATTR_VOLUME

      static final int ATTR_VOLUME
      Volume label attribute
      See Also:
    • ATTR_DIRECTORY

      static final int ATTR_DIRECTORY
      Directory attribute
      See Also:
    • ATTR_ARCHIVE

      static final int ATTR_ARCHIVE
      Archive attribute
      See Also:
    • ATTR_COMPRESSED

      static final int ATTR_COMPRESSED
      Compressed file attribute
      See Also:
    • ATTR_NORMAL

      static final int ATTR_NORMAL
      Normal file attribute
      See Also:
    • ATTR_TEMPORARY

      static final int ATTR_TEMPORARY
      Temporary file attribute
      See Also:
    • FILE_READ_DATA

      static final int FILE_READ_DATA
      File read data access right
      See Also:
    • FILE_WRITE_DATA

      static final int FILE_WRITE_DATA
      File write data access right
      See Also:
    • FILE_APPEND_DATA

      static final int FILE_APPEND_DATA
      File append data access right
      See Also:
    • FILE_READ_EA

      static final int FILE_READ_EA
      File read extended attributes access right
      See Also:
    • FILE_WRITE_EA

      static final int FILE_WRITE_EA
      File write extended attributes access right
      See Also:
    • FILE_EXECUTE

      static final int FILE_EXECUTE
      File execute access right
      See Also:
    • FILE_DELETE

      static final int FILE_DELETE
      File delete child access right
      See Also:
    • FILE_READ_ATTRIBUTES

      static final int FILE_READ_ATTRIBUTES
      File read attributes access right
      See Also:
    • FILE_WRITE_ATTRIBUTES

      static final int FILE_WRITE_ATTRIBUTES
      File write attributes access right
      See Also:
    • DELETE

      static final int DELETE
      Delete access right
      See Also:
    • READ_CONTROL

      static final int READ_CONTROL
      Read control access right
      See Also:
    • WRITE_DAC

      static final int WRITE_DAC
      Write DAC access right
      See Also:
    • WRITE_OWNER

      static final int WRITE_OWNER
      Write owner access right
      See Also:
    • SYNCHRONIZE

      static final int SYNCHRONIZE
      Synchronize access right
      See Also:
    • GENERIC_ALL

      static final int GENERIC_ALL
      Generic all access right
      See Also:
    • GENERIC_EXECUTE

      static final int GENERIC_EXECUTE
      Generic execute access right
      See Also:
    • GENERIC_WRITE

      static final int GENERIC_WRITE
      Generic write access right
      See Also:
    • GENERIC_READ

      static final int GENERIC_READ
      Generic read access right
      See Also:
    • FLAGS_TARGET_MUST_BE_FILE

      static final int FLAGS_TARGET_MUST_BE_FILE
      Target must be file flag
      See Also:
    • FLAGS_TARGET_MUST_BE_DIRECTORY

      static final int FLAGS_TARGET_MUST_BE_DIRECTORY
      Target must be directory flag
      See Also:
    • FLAGS_COPY_TARGET_MODE_ASCII

      static final int FLAGS_COPY_TARGET_MODE_ASCII
      Copy target mode ASCII flag
      See Also:
    • FLAGS_COPY_SOURCE_MODE_ASCII

      static final int FLAGS_COPY_SOURCE_MODE_ASCII
      Copy source mode ASCII flag
      See Also:
    • FLAGS_VERIFY_ALL_WRITES

      static final int FLAGS_VERIFY_ALL_WRITES
      Verify all writes flag
      See Also:
    • FLAGS_TREE_COPY

      static final int FLAGS_TREE_COPY
      Tree copy flag
      See Also:
    • OPEN_FUNCTION_FAIL_IF_EXISTS

      static final int OPEN_FUNCTION_FAIL_IF_EXISTS
      Open function fail if exists
      See Also:
    • OPEN_FUNCTION_OVERWRITE_IF_EXISTS

      static final int OPEN_FUNCTION_OVERWRITE_IF_EXISTS
      Open function overwrite if exists
      See Also:
    • PID

      static final int PID
      Process ID
    • SECURITY_SHARE

      static final int SECURITY_SHARE
      Share level security
      See Also:
    • SECURITY_USER

      static final int SECURITY_USER
      User level security
      See Also:
    • CMD_OFFSET

      static final int CMD_OFFSET
      Command offset in SMB header
      See Also:
    • ERROR_CODE_OFFSET

      static final int ERROR_CODE_OFFSET
      Error code offset in SMB header
      See Also:
    • FLAGS_OFFSET

      static final int FLAGS_OFFSET
      Flags offset in SMB header
      See Also:
    • SIGNATURE_OFFSET

      static final int SIGNATURE_OFFSET
      Signature offset in SMB header
      See Also:
    • TID_OFFSET

      static final int TID_OFFSET
      TID offset in SMB header
      See Also:
    • HEADER_LENGTH

      static final int HEADER_LENGTH
      SMB header length
      See Also:
    • MILLISECONDS_BETWEEN_1970_AND_1601

      static final long MILLISECONDS_BETWEEN_1970_AND_1601
      Milliseconds between 1970 and 1601
      See Also:
    • TZ

      static final TimeZone TZ
      Default timezone
    • USE_BATCHING

      static final boolean USE_BATCHING
      Whether to use batching
    • OEM_ENCODING

      static final String OEM_ENCODING
      OEM encoding
    • UNI_ENCODING

      static final String UNI_ENCODING
      Unicode encoding
      See Also:
    • DEFAULT_FLAGS2

      static final int DEFAULT_FLAGS2
      Default FLAGS2 value
    • DEFAULT_CAPABILITIES

      static final int DEFAULT_CAPABILITIES
      Default capabilities
    • FLAGS2

      static final int FLAGS2
      FLAGS2 value
    • CAPABILITIES

      static final int CAPABILITIES
      Capabilities value
    • TCP_NODELAY

      static final boolean TCP_NODELAY
      Whether to use TCP_NODELAY
    • RESPONSE_TIMEOUT

      static final int RESPONSE_TIMEOUT
      Response timeout in milliseconds
    • CONNECTIONS

      static final LinkedList CONNECTIONS
      List of active connections
    • SSN_LIMIT

      static final int SSN_LIMIT
      Session limit
    • SO_TIMEOUT

      static final int SO_TIMEOUT
      Socket timeout in milliseconds
    • CONN_TIMEOUT

      static final int CONN_TIMEOUT
      Connection timeout in milliseconds
    • NATIVE_OS

      static final String NATIVE_OS
      Native operating system name
    • NATIVE_LANMAN

      static final String NATIVE_LANMAN
      Native LAN manager name
    • VC_NUMBER

      static final int VC_NUMBER
      Virtual circuit number
      See Also:
    • NULL_TRANSPORT

      static final SmbTransport NULL_TRANSPORT
      Null transport instance
  • Constructor Details

    • SigningDigest

      public SigningDigest(byte[] macSigningKey, boolean bypass) throws SmbException
      Constructs a new signing digest with the specified MAC signing key.
      Parameters:
      macSigningKey - the MAC signing key for message authentication
      bypass - whether to bypass MAC signing
      Throws:
      SmbException - if MD5 algorithm is not available
    • SigningDigest

      public SigningDigest(SmbTransport transport, NtlmPasswordAuthentication auth) throws SmbException
      Constructs a new signing digest using transport and authentication credentials.
      Parameters:
      transport - the SMB transport for this signing context
      auth - the NTLM password authentication credentials
      Throws:
      SmbException - if MD5 algorithm is not available or key generation fails
  • Method Details

    • update

      public void update(byte[] input, int offset, int len)
      Updates the digest with the specified data.
      Parameters:
      input - the input buffer containing data to digest
      offset - the offset in the buffer where data starts
      len - the length of data to digest
    • digest

      public byte[] digest()
      Computes and returns the message digest.
      Returns:
      the computed digest bytes
    • toString

      public String toString()
      Overrides:
      toString in class Object