Module jcifs

Class NegTokenInit

java.lang.Object
org.codelibs.jcifs.smb.spnego.SpnegoToken
org.codelibs.jcifs.smb.spnego.NegTokenInit

public class NegTokenInit extends SpnegoToken
SPNEGO initial token
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Context flag for anonymity capability
    static final int
    Context flag for confidentiality (encryption) capability
    static final int
    Context flag for delegation capability
    static final int
    Context flag for integrity (signing) capability
    static final int
    Context flag for mutual authentication requirement
    static final int
    Context flag for replay detection capability
    static final int
    Context flag for sequence checking capability
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for NegTokenInit
    NegTokenInit(byte[] token)
    Constructs a NegTokenInit by parsing the provided token bytes
    NegTokenInit(org.bouncycastle.asn1.ASN1ObjectIdentifier[] mechanisms, int contextFlags, byte[] mechanismToken, byte[] mechanismListMIC)
    Constructs a NegTokenInit with the specified parameters
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    getContextFlag(int flag)
    Checks if a specific context flag is set
    int
    Gets the context flags indicating security capabilities
    org.bouncycastle.asn1.ASN1ObjectIdentifier[]
    Gets the array of supported authentication mechanisms
    protected void
    parse(byte[] token)
    Parses the provided token bytes to populate this SPNEGO token
    void
    setContextFlag(int flag, boolean value)
    Sets or clears a specific context flag
    void
    setContextFlags(int contextFlags)
    Sets the context flags indicating security capabilities
    void
    setMechanisms(org.bouncycastle.asn1.ASN1ObjectIdentifier[] mechanisms)
    Sets the array of supported authentication mechanisms
    byte[]
    Encodes this SPNEGO token to a byte array

    Methods inherited from class org.codelibs.jcifs.smb.spnego.SpnegoToken

    getMechanismListMIC, getMechanismToken, setMechanismListMIC, setMechanismToken

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • DELEGATION

      public static final int DELEGATION
      Context flag for delegation capability
      See Also:
    • MUTUAL_AUTHENTICATION

      public static final int MUTUAL_AUTHENTICATION
      Context flag for mutual authentication requirement
      See Also:
    • REPLAY_DETECTION

      public static final int REPLAY_DETECTION
      Context flag for replay detection capability
      See Also:
    • SEQUENCE_CHECKING

      public static final int SEQUENCE_CHECKING
      Context flag for sequence checking capability
      See Also:
    • ANONYMITY

      public static final int ANONYMITY
      Context flag for anonymity capability
      See Also:
    • CONFIDENTIALITY

      public static final int CONFIDENTIALITY
      Context flag for confidentiality (encryption) capability
      See Also:
    • INTEGRITY

      public static final int INTEGRITY
      Context flag for integrity (signing) capability
      See Also:
  • Constructor Details

    • NegTokenInit

      public NegTokenInit()
      Default constructor for NegTokenInit
    • NegTokenInit

      public NegTokenInit(org.bouncycastle.asn1.ASN1ObjectIdentifier[] mechanisms, int contextFlags, byte[] mechanismToken, byte[] mechanismListMIC)
      Constructs a NegTokenInit with the specified parameters
      Parameters:
      mechanisms - the array of supported authentication mechanisms
      contextFlags - the context flags indicating security capabilities
      mechanismToken - the initial token for the selected mechanism
      mechanismListMIC - the MIC over the mechanism list
    • NegTokenInit

      public NegTokenInit(byte[] token) throws IOException
      Constructs a NegTokenInit by parsing the provided token bytes
      Parameters:
      token - the SPNEGO token bytes to parse
      Throws:
      IOException - if parsing fails
  • Method Details

    • getContextFlags

      public int getContextFlags()
      Gets the context flags indicating security capabilities
      Returns:
      the context flags
    • setContextFlags

      public void setContextFlags(int contextFlags)
      Sets the context flags indicating security capabilities
      Parameters:
      contextFlags - the context flags to set
    • getContextFlag

      public boolean getContextFlag(int flag)
      Checks if a specific context flag is set
      Parameters:
      flag - the context flag to check
      Returns:
      true if the flag is set, false otherwise
    • setContextFlag

      public void setContextFlag(int flag, boolean value)
      Sets or clears a specific context flag
      Parameters:
      flag - the context flag to set or clear
      value - true to set the flag, false to clear it
    • getMechanisms

      public org.bouncycastle.asn1.ASN1ObjectIdentifier[] getMechanisms()
      Gets the array of supported authentication mechanisms
      Returns:
      the mechanisms array
    • setMechanisms

      public void setMechanisms(org.bouncycastle.asn1.ASN1ObjectIdentifier[] mechanisms)
      Sets the array of supported authentication mechanisms
      Parameters:
      mechanisms - the mechanisms to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • toByteArray

      public byte[] toByteArray()
      Description copied from class: SpnegoToken
      Encodes this SPNEGO token to a byte array
      Specified by:
      toByteArray in class SpnegoToken
      Returns:
      the encoded token bytes
    • parse

      protected void parse(byte[] token) throws IOException
      Description copied from class: SpnegoToken
      Parses the provided token bytes to populate this SPNEGO token
      Specified by:
      parse in class SpnegoToken
      Parameters:
      token - the token bytes to parse
      Throws:
      IOException - if parsing fails