java.lang.Object
org.codelibs.jcifs.smb.spnego.SpnegoToken
org.codelibs.jcifs.smb.spnego.NegTokenTarg
SPNEGO response token (NegTokenTarg) used in SPNEGO authentication exchanges
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intResult code indicating authentication completed successfullystatic final intResult code indicating authentication is incomplete and additional tokens requiredstatic final intResult code indicating authentication was rejectedstatic final intResult code indicating MIC token is requestedstatic final intResult code indicating unspecified result -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for NegTokenTargNegTokenTarg(byte[] token) Constructs a NegTokenTarg by parsing the provided token bytesNegTokenTarg(int result, org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism, byte[] mechanismToken, byte[] mechanismListMIC) Constructs a NegTokenTarg with the specified parameters -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.asn1.ASN1ObjectIdentifierGets the selected authentication mechanism OIDintGets the negotiation result codeprotected voidparse(byte[] token) Parses the provided token bytes to populate this SPNEGO tokenvoidsetMechanism(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism) Sets the selected authentication mechanism OIDvoidsetResult(int result) Sets the negotiation result codebyte[]Encodes this SPNEGO token to a byte arrayMethods inherited from class org.codelibs.jcifs.smb.spnego.SpnegoToken
getMechanismListMIC, getMechanismToken, setMechanismListMIC, setMechanismToken
-
Field Details
-
UNSPECIFIED_RESULT
public static final int UNSPECIFIED_RESULTResult code indicating unspecified result- See Also:
-
ACCEPT_COMPLETED
public static final int ACCEPT_COMPLETEDResult code indicating authentication completed successfully- See Also:
-
ACCEPT_INCOMPLETE
public static final int ACCEPT_INCOMPLETEResult code indicating authentication is incomplete and additional tokens required- See Also:
-
REJECTED
public static final int REJECTEDResult code indicating authentication was rejected- See Also:
-
REQUEST_MIC
public static final int REQUEST_MICResult 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 codemechanism- the selected authentication mechanism OIDmechanismToken- the response token for the selected mechanismmechanismListMIC- the MIC over the mechanism list
-
NegTokenTarg
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: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
-