java.lang.Object
org.codelibs.jcifs.smb.spnego.SpnegoToken
org.codelibs.jcifs.smb.spnego.NegTokenInit
SPNEGO initial token
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intContext flag for anonymity capabilitystatic final intContext flag for confidentiality (encryption) capabilitystatic final intContext flag for delegation capabilitystatic final intContext flag for integrity (signing) capabilitystatic final intContext flag for mutual authentication requirementstatic final intContext flag for replay detection capabilitystatic final intContext flag for sequence checking capability -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for NegTokenInitNegTokenInit(byte[] token) Constructs a NegTokenInit by parsing the provided token bytesNegTokenInit(org.bouncycastle.asn1.ASN1ObjectIdentifier[] mechanisms, int contextFlags, byte[] mechanismToken, byte[] mechanismListMIC) Constructs a NegTokenInit with the specified parameters -
Method Summary
Modifier and TypeMethodDescriptionbooleangetContextFlag(int flag) Checks if a specific context flag is setintGets the context flags indicating security capabilitiesorg.bouncycastle.asn1.ASN1ObjectIdentifier[]Gets the array of supported authentication mechanismsprotected voidparse(byte[] token) Parses the provided token bytes to populate this SPNEGO tokenvoidsetContextFlag(int flag, boolean value) Sets or clears a specific context flagvoidsetContextFlags(int contextFlags) Sets the context flags indicating security capabilitiesvoidsetMechanisms(org.bouncycastle.asn1.ASN1ObjectIdentifier[] mechanisms) Sets the array of supported authentication mechanismsbyte[]Encodes this SPNEGO token to a byte arraytoString()Methods inherited from class org.codelibs.jcifs.smb.spnego.SpnegoToken
getMechanismListMIC, getMechanismToken, setMechanismListMIC, setMechanismToken
-
Field Details
-
DELEGATION
public static final int DELEGATIONContext flag for delegation capability- See Also:
-
MUTUAL_AUTHENTICATION
public static final int MUTUAL_AUTHENTICATIONContext flag for mutual authentication requirement- See Also:
-
REPLAY_DETECTION
public static final int REPLAY_DETECTIONContext flag for replay detection capability- See Also:
-
SEQUENCE_CHECKING
public static final int SEQUENCE_CHECKINGContext flag for sequence checking capability- See Also:
-
ANONYMITY
public static final int ANONYMITYContext flag for anonymity capability- See Also:
-
CONFIDENTIALITY
public static final int CONFIDENTIALITYContext flag for confidentiality (encryption) capability- See Also:
-
INTEGRITY
public static final int INTEGRITYContext 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 mechanismscontextFlags- the context flags indicating security capabilitiesmechanismToken- the initial token for the selected mechanismmechanismListMIC- the MIC over the mechanism list
-
NegTokenInit
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 clearvalue- 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
-
toByteArray
public byte[] toByteArray()Description copied from class:SpnegoTokenEncodes this SPNEGO token to a byte array- Specified by:
toByteArrayin classSpnegoToken- Returns:
- the encoded token bytes
-
parse
Description copied from class:SpnegoTokenParses the provided token bytes to populate this SPNEGO token- Specified by:
parsein classSpnegoToken- Parameters:
token- the token bytes to parse- Throws:
IOException- if parsing fails
-