public class

GSSException

extends Exception
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ org.ietf.jgss.GSSException
Known Direct Subclasses

Class Overview

This exception is thrown whenever a GSS-API error occurs, including any mechanism specific error. It may contain both the major and the minor GSS-API status codes. Major error codes are those defined at the GSS-API level in this class. Minor error codes are mechanism specific error codes that can provide additional information. The underlying mechanism implementation is responsible for setting appropriate minor status codes when throwing this exception. Aside from delivering the numeric error codes to the caller, this class performs the mapping from their numeric values to textual representations.

Summary

Constants
int BAD_BINDINGS Channel bindings mismatch.
int BAD_MECH Unsupported mechanism requested.
int BAD_MIC Token had invalid integrity check.
int BAD_NAME Invalid name provided.
int BAD_NAMETYPE Name of unsupported type provided.
int BAD_QOP Unsupported QOP value.
int BAD_STATUS Invalid status code.
int CONTEXT_EXPIRED Security context expired.
int CREDENTIALS_EXPIRED Expired credentials.
int DEFECTIVE_CREDENTIAL Defective credentials.
int DEFECTIVE_TOKEN Defective token.
int DUPLICATE_ELEMENT Duplicate credential element requested.
int DUPLICATE_TOKEN The token was a duplicate of an earlier token.
int FAILURE General failure, unspecified at GSS-API level.
int GAP_TOKEN An expected per-message token was not received.
int NAME_NOT_MN Name contains multi-mechanism elements.
int NO_CONTEXT Invalid security context.
int NO_CRED Invalid credentials.
int OLD_TOKEN The token's validity period has expired.
int UNAUTHORIZED Operation unauthorized.
int UNAVAILABLE Operation unavailable.
int UNSEQ_TOKEN A later token has already been processed.
Public Constructors
GSSException(int majorCode)
Creates a GSSException object with a specified major code.
GSSException(int majorCode, int minorCode, String minorString)
Creates a GSSException object with the specified major code, minor code, and minor code textual explanation.
Public Methods
int getMajor()
Returns the GSS-API level major error code for the problem causing this exception to be thrown.
String getMajorString()
Returns a string explaining the GSS-API level major error code in this exception.
String getMessage()
Returns a textual representation of both the major and the minor status codes.
int getMinor()
Returns the mechanism level error code for the problem causing this exception to be thrown.
String getMinorString()
Returns a string explaining the mechanism specific error code.
void setMinor(int minorCode, String message)
Used by the exception thrower to set the mechanism level minor error code and its string explanation.
String toString()
Returns a textual representation of both the major and the minor status codes.
[Expand]
Inherited Methods
From class java.lang.Throwable
From class java.lang.Object

Constants

public static final int BAD_BINDINGS

Channel bindings mismatch.

Constant Value: 1 (0x00000001)

public static final int BAD_MECH

Unsupported mechanism requested.

Constant Value: 2 (0x00000002)

public static final int BAD_MIC

Token had invalid integrity check.

Constant Value: 6 (0x00000006)

public static final int BAD_NAME

Invalid name provided.

Constant Value: 3 (0x00000003)

public static final int BAD_NAMETYPE

Name of unsupported type provided.

Constant Value: 4 (0x00000004)

public static final int BAD_QOP

Unsupported QOP value.

Constant Value: 14 (0x0000000e)

public static final int BAD_STATUS

Invalid status code.

Constant Value: 5 (0x00000005)

public static final int CONTEXT_EXPIRED

Security context expired.

Constant Value: 7 (0x00000007)

public static final int CREDENTIALS_EXPIRED

Expired credentials.

Constant Value: 8 (0x00000008)

public static final int DEFECTIVE_CREDENTIAL

Defective credentials.

Constant Value: 9 (0x00000009)

public static final int DEFECTIVE_TOKEN

Defective token.

Constant Value: 10 (0x0000000a)

public static final int DUPLICATE_ELEMENT

Duplicate credential element requested.

Constant Value: 17 (0x00000011)

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.

Constant Value: 19 (0x00000013)

public static final int FAILURE

General failure, unspecified at GSS-API level.

Constant Value: 11 (0x0000000b)

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.

Constant Value: 22 (0x00000016)

public static final int NAME_NOT_MN

Name contains multi-mechanism elements.

Constant Value: 18 (0x00000012)

public static final int NO_CONTEXT

Invalid security context.

Constant Value: 12 (0x0000000c)

public static final int NO_CRED

Invalid credentials.

Constant Value: 13 (0x0000000d)

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.

Constant Value: 20 (0x00000014)

public static final int UNAUTHORIZED

Operation unauthorized.

Constant Value: 15 (0x0000000f)

public static final int UNAVAILABLE

Operation unavailable.

Constant Value: 16 (0x00000010)

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.

Constant Value: 21 (0x00000015)

Public Constructors

public GSSException (int majorCode)

Creates a GSSException object with a specified major code.

Parameters
majorCode the The GSS error code for the problem causing this exception to be thrown.

public GSSException (int majorCode, int minorCode, 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 underlying mechanism level. It allows the setting of both the GSS code and the mechanism code.

Parameters
majorCode the GSS error code for the problem causing this exception to be thrown.
minorCode the mechanism level error code for the problem causing this exception to be thrown.
minorString the textual explanation of the mechanism error code.

Public Methods

public int getMajor ()

Returns the GSS-API level major error code for the problem causing this exception to be thrown. Major error codes are defined at the mechanism independent GSS-API level in this class. Mechanism specific error codes that might provide more information aer set as the minor error code.

Returns
  • int the GSS-API level major error code causing this exception

public String getMajorString ()

Returns a string explaining the GSS-API level major error code in this exception.

Returns
  • String explanation string for the major error code

public String getMessage ()

Returns a textual representation of both the major and the minor status codes.

Returns
  • a String with the error descriptions

public int getMinor ()

Returns the mechanism level error code for the problem causing this exception to be thrown. The minor code is set by the underlying mechanism.

Returns
  • int the mechanism error code; 0 indicates that it has not been set.

public String getMinorString ()

Returns a string explaining the mechanism specific error code. If the minor status code is 0, then no mechanism level error details will be available.

Returns
  • String a textual explanation of mechanism error code

public void setMinor (int minorCode, String message)

Used by the exception thrower to set the mechanism level minor error code and its string explanation. This is used by mechanism providers to indicate error details.

Parameters
minorCode the mechanism specific error code
message textual explanation of the mechanism error code
See Also

public String toString ()

Returns a textual representation of both the major and the minor status codes.

Returns
  • a String with the error descriptions