APIdia Launch Partner
Top Description Fields Constructors Methods
org.ietf.jgss

public Class GSSException

extends Exception
Class Inheritance
Known Direct Subclasses
sun.security.jgss.GSSExceptionImpl
Imports
java.io.Serial, java.util.Objects

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.
Author
Mayank Upadhyay
Since
1.4

Field Summary

Modifier and TypeField and Description
public static final int
BAD_BINDINGS

Channel bindings mismatch.

public static final int
BAD_MECH

Unsupported mechanism requested.

public static final int
BAD_MIC

Token had invalid integrity check.

public static final int
BAD_NAME

Invalid name provided.

public static final int
BAD_NAMETYPE

Name of unsupported type provided.

public static final int
BAD_QOP

Unsupported QOP value.

public static final int
BAD_STATUS

Invalid status code.

public static final int
CONTEXT_EXPIRED

Security context expired.

public static final int
CREDENTIALS_EXPIRED

Expired credentials.

public static final int
DEFECTIVE_CREDENTIAL

Defective credentials.

public static final int
DEFECTIVE_TOKEN

Defective token.

public static final int
DUPLICATE_ELEMENT

Duplicate credential element requested.

public static final int
DUPLICATE_TOKEN

The token was a duplicate of an earlier token.

public static final int
FAILURE

General failure, unspecified at GSS-API level.

public static final int
GAP_TOKEN

An expected per-message token was not received.

private final int
major

The major code for this exception

private String
majorString

Alternate text string for major code

private static final String[]
private int
minor

The minor code for this exception

private String
minorMessage

The text string for minor code

public static final int
NAME_NOT_MN

Name contains multi-mechanism elements.

public static final int
NO_CONTEXT

Invalid security context.

public static final int
NO_CRED

Invalid credentials.

public static final int
OLD_TOKEN

The token's validity period has expired.

private static final long
public static final int
UNAUTHORIZED

Operation unauthorized.

public static final int
UNAVAILABLE

Operation unavailable.

public static final int
UNSEQ_TOKEN

A later token has already been processed.

Constructor Summary

AccessConstructor and Description
public
GSSException(int
the GSS error code for the problem causing this exception to be thrown.
majorCode
)

Creates a GSSException object with a specified major code.

pack-priv
GSSException(int
the fatal error code causing this exception.
majorCode
,
String
an explicit message to be included in this exception
majorString
)

Construct a GSSException object with a specified major code and a specific major string for it.

public
GSSException(int
the GSS error code for the problem causing this exception to be thrown.
majorCode
,
int
the mechanism level error code for the problem causing this exception to be thrown.
minorCode
,
String
the textual explanation of the mechanism error code.
minorString
)

Creates a GSSException object with the specified major code, minor code, and minor code textual explanation.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

int the GSS-API level major error code causing this exception
getMajor
()

Returns the GSS-API level major error code for the problem causing this exception to be thrown.

public String

Returns:

String explanation string for the major error code
getMajorString
()

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

public String

Returns:

a String with the error descriptions
getMessage
()

Overrides java.lang.Throwable.getMessage.

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

public int

Returns:

int the mechanism error code; 0 indicates that it has not been set.
getMinor
()

Returns the mechanism level error code for the problem causing this exception to be thrown.

public String

Returns:

String a textual explanation of mechanism error code
getMinorString
()

Returns a string explaining the mechanism specific error code.

public void
setMinor(int
the mechanism specific error code
minorCode
,
String
textual explanation of the mechanism error code
message
)

Used by the exception thrower to set the mechanism level minor error code and its string explanation.

public String

Returns:

a String with the error descriptions
toString
()

Overrides java.lang.Throwable.toString.

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

private boolean
validateMajor(int major)

Field Detail

BAD_BINDINGSback to summary
public static final int BAD_BINDINGS

Channel bindings mismatch.

BAD_MECHback to summary
public static final int BAD_MECH

Unsupported mechanism requested.

BAD_MICback to summary
public static final int BAD_MIC

Token had invalid integrity check.

BAD_NAMEback to summary
public static final int BAD_NAME

Invalid name provided.

BAD_NAMETYPEback to summary
public static final int BAD_NAMETYPE

Name of unsupported type provided.

BAD_QOPback to summary
public static final int BAD_QOP

Unsupported QOP value.

BAD_STATUSback to summary
public static final int BAD_STATUS

Invalid status code.

CONTEXT_EXPIREDback to summary
public static final int CONTEXT_EXPIRED

Security context expired.

CREDENTIALS_EXPIREDback to summary
public static final int CREDENTIALS_EXPIRED

Expired credentials.

DEFECTIVE_CREDENTIALback to summary
public static final int DEFECTIVE_CREDENTIAL

Defective credentials.

DEFECTIVE_TOKENback to summary
public static final int DEFECTIVE_TOKEN

Defective token.

DUPLICATE_ELEMENTback to summary
public static final int DUPLICATE_ELEMENT

Duplicate credential element requested.

DUPLICATE_TOKENback to summary
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.

FAILUREback to summary
public static final int FAILURE

General failure, unspecified at GSS-API level.

GAP_TOKENback to summary
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.

majorback to summary
private final int major

The major code for this exception

majorStringback to summary
private String majorString

Alternate text string for major code

messagesback to summary
private static final String[] messages
minorback to summary
private int minor

The minor code for this exception

minorMessageback to summary
private String minorMessage

The text string for minor code

NAME_NOT_MNback to summary
public static final int NAME_NOT_MN

Name contains multi-mechanism elements.

NO_CONTEXTback to summary
public static final int NO_CONTEXT

Invalid security context.

NO_CREDback to summary
public static final int NO_CRED

Invalid credentials.

OLD_TOKENback to summary
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.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.Exception.serialVersionUID.

Annotations
@Serial
UNAUTHORIZEDback to summary
public static final int UNAUTHORIZED

Operation unauthorized.

UNAVAILABLEback to summary
public static final int UNAVAILABLE

Operation unavailable.

UNSEQ_TOKENback to summary
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

GSSExceptionback to summary
public GSSException(int majorCode)

Creates a GSSException object with a specified major code.

Parameters
majorCode:int

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

GSSExceptionback to summary
pack-priv GSSException(int majorCode, String majorString)

Construct a GSSException object with a specified major code and a specific major string for it.

Parameters
majorCode:int

the fatal error code causing this exception.

majorString:String

an explicit message to be included in this exception

GSSExceptionback to summary
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:int

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

minorCode:int

the mechanism level error code for the problem causing this exception to be thrown.

minorString:String

the textual explanation of the mechanism error code.

Method Detail

getMajorback to summary
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 are set as the minor error code.

Returns:int

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

See Also
getMajorString, getMinor, getMinorString
getMajorStringback to summary
public String getMajorString()

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

Returns:String

String explanation string for the major error code

See Also
getMajor, toString
getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

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

Returns:String

a String with the error descriptions

getMinorback to summary
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

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

See Also
getMinorString, setMinor
getMinorStringback to summary
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

String a textual explanation of mechanism error code

See Also
getMinor, getMajorString, toString
setMinorback to summary
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:int

the mechanism specific error code

message:String

textual explanation of the mechanism error code

See Also
getMinor
toStringback to summary
public String toString()

Overrides java.lang.Throwable.toString.

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

Returns:String

a String with the error descriptions

validateMajorback to summary
private boolean validateMajor(int major)