Module jcifs

Class NegTokenTarg

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

public class NegTokenTarg extends SpnegoToken
SPNEGO response token (NegTokenTarg) used in SPNEGO authentication exchanges
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Result code indicating authentication completed successfully
    static final int
    Result code indicating authentication is incomplete and additional tokens required
    static final int
    Result code indicating authentication was rejected
    static final int
    Result code indicating MIC token is requested
    static final int
    Result code indicating unspecified result
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    org.bouncycastle.asn1.ASN1ObjectIdentifier
    Gets the selected authentication mechanism OID
    int
    Gets the negotiation result code
    protected void
    parse(byte[] token)
    Parses the provided token bytes to populate this SPNEGO token
    void
    setMechanism(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism)
    Sets the selected authentication mechanism OID
    void
    setResult(int result)
    Sets the negotiation result code
    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, toString, wait, wait, wait
  • Field Details

    • UNSPECIFIED_RESULT

      public static final int UNSPECIFIED_RESULT
      Result code indicating unspecified result
      See Also:
    • ACCEPT_COMPLETED

      public static final int ACCEPT_COMPLETED
      Result code indicating authentication completed successfully
      See Also:
    • ACCEPT_INCOMPLETE

      public static final int ACCEPT_INCOMPLETE
      Result code indicating authentication is incomplete and additional tokens required
      See Also:
    • REJECTED

      public static final int REJECTED
      Result code indicating authentication was rejected
      See Also:
    • REQUEST_MIC

      public static final int REQUEST_MIC
      Result code indicating MIC token is requested
      See Also:
  • Constructor Details

    • NegTokenTarg

      public NegTokenTarg()
      Default constructor for NegTokenTarg
    • NegTokenTarg

      public NegTokenTarg(int result, org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism, byte[] mechanismToken, byte[] mechanismListMIC)
      Constructs a NegTokenTarg with the specified parameters
      Parameters:
      result - the negotiation result code
      mechanism - the selected authentication mechanism OID
      mechanismToken - the response token for the selected mechanism
      mechanismListMIC - the MIC over the mechanism list
    • NegTokenTarg

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

    • getResult

      public int getResult()
      Gets the negotiation result code
      Returns:
      the result code
    • setResult

      public void setResult(int result)
      Sets the negotiation result code
      Parameters:
      result - the result code to set
    • getMechanism

      public org.bouncycastle.asn1.ASN1ObjectIdentifier getMechanism()
      Gets the selected authentication mechanism OID
      Returns:
      the mechanism OID
    • setMechanism

      public void setMechanism(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism)
      Sets the selected authentication mechanism OID
      Parameters:
      mechanism - the mechanism OID to set
    • 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