org.ietf.jgss

Class GSSException

public class GSSException extends Exception

This exception is thrown whenever a fatal GSS-API error occurs including mechanism specific errors. It may contain both, the major and minor, GSS-API status codes. The mechanism implementers are responsible for setting appropriate minor status codes when throwing this exception. Aside from delivering the numeric error code(s) to the caller, this class performs the mapping from their numeric values to textual representations. All Java GSS-API methods are declared throwing this exception.

UNKNOWN: Some of the constant values defined in this class were chosen to be compatible with J2SE 1.4, and not with RFC 2853.

Field Summary
static intBAD_BINDINGS
Channel bindings mismatch error.
static intBAD_MECH
Unsupported mechanism requested error.
static intBAD_MIC
Token had invalid integrity check error.
static intBAD_NAME
Invalid name provided error.
static intBAD_NAMETYPE
Name of unsupported type provided error.
static intBAD_QOP
Unsupported QOP value error.
static intBAD_STATUS
Invalid status code error - this is the default status value.
static intCONTEXT_EXPIRED
Specified security context expired error.
static intCREDENTIALS_EXPIRED
Expired credentials detected error.
static intDEFECTIVE_CREDENTIAL
Defective credential error.
static intDEFECTIVE_TOKEN
Defective token error.
static intDUPLICATE_ELEMENT
Duplicate credential element requested error.
static intDUPLICATE_TOKEN
The token was a duplicate of an earlier token.
static intFAILURE
General failure, unspecified at GSS-API level.
static intGAP_TOKEN
An expected per-message token was not received.
static intNAME_NOT_MN
Name contains multi-mechanism elements error.
static intNO_CONTEXT
Invalid security context error.
static intNO_CRED
Invalid credentials error.
static intOLD_TOKEN
The token's validity period has expired.
static intUNAUTHORIZED
Operation unauthorized error.
static intUNAVAILABLE
Operation unavailable error.
static intUNSEQ_TOKEN
A later token has already been processed.
Constructor Summary
GSSException(int major)
Create a new GSS exception with the given major code.
GSSException(int major, int minor, String minorString)
Create a new GSS exception with the given major and minor codes, and a minor explanation string.
Method Summary
intgetMajor()
Returns the major code representing the GSS error code that caused this exception to be thrown.
StringgetMajorString()
Returns a string explaining the GSS major error code causing this exception to be thrown.
StringgetMessage()
Returns a detailed message of this exception.
intgetMinor()
Returns the mechanism error code that caused this exception.
StringgetMinorString()
Returns a string explaining the mechanism specific error code.
voidsetMinor(int minorCode, String message)
Used internally by the GSS-API implementation and the underlying mechanisms to set the minor code and its textual representation.
StringtoString()
Returns a textual representation of both the major and minor status codes.

Field Detail

BAD_BINDINGS

public static final int BAD_BINDINGS
Channel bindings mismatch error.

UNKNOWN: Should be 4 according to RFC 2853.

BAD_MECH

public static final int BAD_MECH
Unsupported mechanism requested error.

UNKNOWN: Should be 1 according to RFC 2853.

BAD_MIC

public static final int BAD_MIC
Token had invalid integrity check error.

BAD_NAME

public static final int BAD_NAME
Invalid name provided error.

UNKNOWN: Should be 2 according to RFC 2853.

BAD_NAMETYPE

public static final int BAD_NAMETYPE
Name of unsupported type provided error.

UNKNOWN: Should be 3 according to RFC 2853.

BAD_QOP

public static final int BAD_QOP
Unsupported QOP value error.

BAD_STATUS

public static final int BAD_STATUS
Invalid status code error - this is the default status value.

CONTEXT_EXPIRED

public static final int CONTEXT_EXPIRED
Specified security context expired error.

UNKNOWN: Should be 12 according to RFC 2853.

CREDENTIALS_EXPIRED

public static final int CREDENTIALS_EXPIRED
Expired credentials detected error.

UNKNOWN: Should be 11 according to RFC 2853.

DEFECTIVE_CREDENTIAL

public static final int DEFECTIVE_CREDENTIAL
Defective credential error.

UNKNOWN: Should be 10 according to RFC 2853.

DEFECTIVE_TOKEN

public static final int DEFECTIVE_TOKEN
Defective token error.

UNKNOWN: Should be 9 according to RFC 2853.

DUPLICATE_ELEMENT

public static final int DUPLICATE_ELEMENT
Duplicate credential element requested error.

DUPLICATE_TOKEN

public static final int DUPLICATE_TOKEN
The token was a duplicate of an earlier token. This is a fatal error code that may occur during context establishment. It is not used to indicate supplementary status values. The MessageProp object is used for that purpose.

UNKNOWN: Should be 20 according to RFC 2853.

FAILURE

public static final int FAILURE
General failure, unspecified at GSS-API level.

UNKNOWN: Should be 13 according to RFC 2853.

GAP_TOKEN

public static final int GAP_TOKEN
An expected per-message token was not received. This is a fatal error code that may occur during context establishment. It is not used to indicate supplementary status values. The MessageProp object is used for that purpose.

NAME_NOT_MN

public static final int NAME_NOT_MN
Name contains multi-mechanism elements error.

NO_CONTEXT

public static final int NO_CONTEXT
Invalid security context error.

UNKNOWN: Should be 8 according to RFC 2853.

NO_CRED

public static final int NO_CRED
Invalid credentials error.

UNKNOWN: Should be 7 according to RFC 2853.

OLD_TOKEN

public static final int OLD_TOKEN
The token's validity period has expired. This is a fatal error code that may occur during context establishment. It is not used to indicate supplementary status values. The MessageProp object is used for that purpose.

UNKNOWN: Should be 19 according to RFC 2853.

UNAUTHORIZED

public static final int UNAUTHORIZED
Operation unauthorized error.

UNAVAILABLE

public static final int UNAVAILABLE
Operation unavailable error.

UNSEQ_TOKEN

public static final int UNSEQ_TOKEN
A later token has already been processed. This is a fatal error code that may occur during context establishment. It is not used to indicate supplementary status values. The MessageProp object is used for that purpose.

Constructor Detail

GSSException

public GSSException(int major)
Create a new GSS exception with the given major code.

Parameters: major The major GSS error code.

GSSException

public GSSException(int major, int minor, String minorString)
Create a new GSS exception with the given major and minor codes, and a minor explanation string.

Parameters: major The major GSS error code. minor The minor application-specific error code. minorString An explanation of the minor error code.

Method Detail

getMajor

public int getMajor()
Returns the major code representing the GSS error code that caused this exception to be thrown.

Returns: The major error code.

getMajorString

public String getMajorString()
Returns a string explaining the GSS major error code causing this exception to be thrown.

Returns: The major error string.

getMessage

public String getMessage()
Returns a detailed message of this exception. Overrides {@link Throwable#getMessage()}. It is customary in Java to use this method to obtain exception information.

Returns: The detail message.

getMinor

public int getMinor()
Returns the mechanism error code that caused this exception. The minor code is set by the underlying mechanism. Value of 0 indicates that mechanism error code is not set.

Returns: The minor error code, or 0 if not set.

getMinorString

public String getMinorString()
Returns a string explaining the mechanism specific error code. null will be returned when no mechanism error code has been set.

Returns: The minor error string, or null.

setMinor

public void setMinor(int minorCode, String message)
Used internally by the GSS-API implementation and the underlying mechanisms to set the minor code and its textual representation.

Parameters: minorCode The mechanism specific error code. message A textual explanation of the mechanism error code.

toString

public String toString()
Returns a textual representation of both the major and minor status codes.

Returns: The textual representation.