Module jcifs

Interface SSPContext

All Known Implementing Classes:
NtlmContext

public interface SSPContext
Security Support Provider (SSP) context. This interface provides context for security support provider operations during SMB authentication.
Author:
mbechler
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    calculateMIC(byte[] data)
    Calculates a Message Integrity Code (MIC) for the given data.
    void
    Disposes of the security context and releases any associated resources.
    int
    Gets the negotiated context flags.
    Gets the NetBIOS name of the remote endpoint.
    byte[]
    Gets the signing key for the session.
    org.bouncycastle.asn1.ASN1ObjectIdentifier[]
    Gets the array of supported security mechanism OIDs.
    byte[]
    initSecContext(byte[] token, int off, int len)
    Initializes the security context with the given token.
    boolean
    Checks whether the security context is established.
    boolean
    Checks whether Message Integrity Code (MIC) is available for use.
    boolean
    isPreferredMech(org.bouncycastle.asn1.ASN1ObjectIdentifier selectedMech)
    Checks whether the specified mechanism is the preferred mechanism.
    boolean
    isSupported(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism)
    Checks whether the specified security mechanism is supported.
    boolean
    Checks whether this mechanism supports message integrity.
    void
    verifyMIC(byte[] data, byte[] mic)
    Verifies a Message Integrity Code (MIC) for the given data.
  • Method Details

    • getSigningKey

      byte[] getSigningKey() throws CIFSException
      Gets the signing key for the session.
      Returns:
      the signing key for the session
      Throws:
      CIFSException - if an error occurs retrieving the signing key
    • isEstablished

      boolean isEstablished()
      Checks whether the security context is established.
      Returns:
      whether the context is established
    • initSecContext

      byte[] initSecContext(byte[] token, int off, int len) throws CIFSException
      Initializes the security context with the given token.
      Parameters:
      token - the input token bytes
      off - offset into the token array
      len - length of token data
      Returns:
      result token
      Throws:
      SmbException - if an SMB protocol error occurs
      CIFSException - if a general CIFS error occurs
    • getNetbiosName

      String getNetbiosName()
      Gets the NetBIOS name of the remote endpoint.
      Returns:
      the name of the remote endpoint
    • dispose

      void dispose() throws CIFSException
      Disposes of the security context and releases any associated resources.
      Throws:
      CIFSException - if an error occurs during disposal
    • isSupported

      boolean isSupported(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism)
      Checks whether the specified security mechanism is supported.
      Parameters:
      mechanism - the security mechanism OID to check
      Returns:
      whether the specified mechanism is supported
    • isPreferredMech

      boolean isPreferredMech(org.bouncycastle.asn1.ASN1ObjectIdentifier selectedMech)
      Checks whether the specified mechanism is the preferred mechanism.
      Parameters:
      selectedMech - the selected mechanism OID
      Returns:
      whether the specified mechanism is preferred
    • getFlags

      int getFlags()
      Gets the negotiated context flags.
      Returns:
      context flags
    • getSupportedMechs

      org.bouncycastle.asn1.ASN1ObjectIdentifier[] getSupportedMechs()
      Gets the array of supported security mechanism OIDs.
      Returns:
      array of supported mechanism OIDs
    • supportsIntegrity

      boolean supportsIntegrity()
      Checks whether this mechanism supports message integrity.
      Returns:
      whether this mechanisms supports integrity
    • calculateMIC

      byte[] calculateMIC(byte[] data) throws CIFSException
      Calculates a Message Integrity Code (MIC) for the given data.
      Parameters:
      data - the data to calculate MIC for
      Returns:
      MIC
      Throws:
      CIFSException - if an error occurs calculating the MIC
    • verifyMIC

      void verifyMIC(byte[] data, byte[] mic) throws CIFSException
      Verifies a Message Integrity Code (MIC) for the given data.
      Parameters:
      data - the data to verify
      mic - the MIC to verify against
      Throws:
      CIFSException - if the MIC verification fails or an error occurs
    • isMICAvailable

      boolean isMICAvailable()
      Checks whether Message Integrity Code (MIC) is available for use.
      Returns:
      whether MIC can be used