org.ietf.jgss
Class GSSException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.ietf.jgss.GSSException
All Implemented Interfaces:
java.io.Serializable

public class GSSException
extends java.lang.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.

All implementations are encouraged to use the Java internationalization techniques to provide local translations of the message strings.

See Also:
Serialized Form
Component:
Security-Core

Field Summary
static int BAD_BINDINGS
          Channel bindings mismatch error.
static int BAD_MECH
          Unsupported mechanism requested error.
static int BAD_MIC
          Token had invalid integrity check error.
static int BAD_NAME
          Invalid name provided error.
static int BAD_NAMETYPE
          Name of unsupported type provided error.
static int BAD_QOP
          Unsupported QOP value error.
static int BAD_STATUS
          Invalid status code error - this is the default status value.
static int CONTEXT_EXPIRED
          Specified security context expired error.
static int CREDENTIALS_EXPIRED
          Expired credentials detected error.
static int DEFECTIVE_CREDENTIAL
          Defective credential error.
static int DEFECTIVE_TOKEN
          Defective token error.
static int DUPLICATE_ELEMENT
          Duplicate credential element requested error.
static int DUPLICATE_TOKEN
          The token was a duplicate of an earlier token.
static int FAILURE
          General failure, unspecified at GSS-API level.
static int GAP_TOKEN
          An expected per-message token was not received.
protected  int majorCode
           
protected  int minorCode
           
protected  java.lang.String minorString
           
static int NAME_NOT_MN
          Name contains multi-mechanism elements error.
static int NO_CONTEXT
          Invalid security context error.
static int NO_CRED
          Invalid credentials error.
static int OLD_TOKEN
          The token's validity period has expired.
static int UNATHORIZED
          Operation unauthorized error.
static int UNAVAILABLE
          Operation unavailable error.
static int UNSEQ_TOKEN
          A later token has already been processed.
 
Constructor Summary
GSSException(int majorCode)
          Creates a GSSException object with a specified major code.
GSSException(int majorCode, int minorCode, java.lang.String minorString)
          Creates a GSSException object with the specified major code, minor code, and minor code textual explanation.
 
Method Summary
 int getMajor()
          Returns the major code representing the GSS error code that caused this exception to be thrown.
 java.lang.String getMajorString()
          Returns a string explaining the GSS major error code causing this exception to be thrown.
 java.lang.String getMessage()
          Returns a detailed message of this exception.
 int getMinor()
          Returns the mechanism error code that caused this exception.
 java.lang.String getMinorString()
          Returns a string explaining the mechanism specific error code.
 void setMinor(int minorCode, java.lang.String message)
          Used internally by the GSS-API implementation and the underlying mechanisms to set the minor code and its textual representation.
 java.lang.String toString()
          Returns a textual representation of both the major and minor status codes.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BAD_BINDINGS

public static final int BAD_BINDINGS
Channel bindings mismatch error.

See Also:
Constant Field Values

BAD_MECH

public static final int BAD_MECH
Unsupported mechanism requested error.

See Also:
Constant Field Values

BAD_NAME

public static final int BAD_NAME
Invalid name provided error.

See Also:
Constant Field Values

BAD_NAMETYPE

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

See Also:
Constant Field Values

BAD_STATUS

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

See Also:
Constant Field Values

BAD_MIC

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

See Also:
Constant Field Values

CONTEXT_EXPIRED

public static final int CONTEXT_EXPIRED
Specified security context expired error.

See Also:
Constant Field Values

CREDENTIALS_EXPIRED

public static final int CREDENTIALS_EXPIRED
Expired credentials detected error.

See Also:
Constant Field Values

DEFECTIVE_CREDENTIAL

public static final int DEFECTIVE_CREDENTIAL
Defective credential error.

See Also:
Constant Field Values

DEFECTIVE_TOKEN

public static final int DEFECTIVE_TOKEN
Defective token error.

See Also:
Constant Field Values

FAILURE

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

See Also:
Constant Field Values

NO_CONTEXT

public static final int NO_CONTEXT
Invalid security context error.

See Also:
Constant Field Values

NO_CRED

public static final int NO_CRED
Invalid credentials error.

See Also:
Constant Field Values

BAD_QOP

public static final int BAD_QOP
Unsupported QOP value error.

See Also:
Constant Field Values

UNATHORIZED

public static final int UNATHORIZED
Operation unauthorized error.

See Also:
Constant Field Values

UNAVAILABLE

public static final int UNAVAILABLE
Operation unavailable error.

See Also:
Constant Field Values

DUPLICATE_ELEMENT

public static final int DUPLICATE_ELEMENT
Duplicate credential element requested error.

See Also:
Constant Field Values

NAME_NOT_MN

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

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

majorCode

protected int majorCode

minorCode

protected int minorCode

minorString

protected java.lang.String minorString
Constructor Detail

GSSException

public GSSException(int majorCode)
Creates a GSSException object with a specified major code.

Parameters:
majorCode - The GSS error code causing this exception to be thrown.

GSSException

public GSSException(int majorCode,
                    int minorCode,
                    java.lang.String minorString)
Creates a GSSException object with the specified major code, minor code, and minor code textual explanation. This constructor is to be used when the exception is originating from the security mechanism. It allows to specify the GSS code and the mechanism code.

Parameters:
majorCode - The GSS error code causing this exception to be thrown.
minorCode - The mechanism error code causing this exception to be thrown.
minorString - The textual explanation of the mechanism error code.
Method Detail

getMajor

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


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.


getMajorString

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


getMinorString

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


setMinor

public void setMinor(int minorCode,
                     java.lang.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 java.lang.String toString()
Returns a textual representation of both the major and minor status codes.


getMessage

public java.lang.String getMessage()
Returns a detailed message of this exception. Overrides Throwable.getMessage. It is customary in Java to use this method to obtain exception information.