org.ietf.jgss

Class GSSException

Implemented Interfaces:
Serializable

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.
See Also:
Serialized Form

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.
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
UNAUTHORIZED
Operation unauthorized error.
static int
UNAVAILABLE
Operation unavailable error.
static int
UNSEQ_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

int
getMajor()
Returns the major code representing the GSS error code that caused this exception to be thrown.
String
getMajorString()
Returns a string explaining the GSS major error code causing this exception to be thrown.
String
getMessage()
Returns a detailed message of this exception.
int
getMinor()
Returns the mechanism error code that caused this exception.
String
getMinorString()
Returns a string explaining the mechanism specific error code.
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.
String
toString()
Returns a textual representation of both the major and minor status codes.

Methods inherited from class java.lang.Throwable

fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

BAD_BINDINGS

public static final int BAD_BINDINGS
Channel bindings mismatch error.
Field Value:
1

BAD_MECH

public static final int BAD_MECH
Unsupported mechanism requested error.
Field Value:
2

BAD_MIC

public static final int BAD_MIC
Token had invalid integrity check error.
Field Value:
6

BAD_NAME

public static final int BAD_NAME
Invalid name provided error.
Field Value:
3

BAD_NAMETYPE

public static final int BAD_NAMETYPE
Name of unsupported type provided error.
Field Value:
4

BAD_QOP

public static final int BAD_QOP
Unsupported QOP value error.
Field Value:
14

BAD_STATUS

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

CONTEXT_EXPIRED

public static final int CONTEXT_EXPIRED
Specified security context expired error.
Field Value:
7

CREDENTIALS_EXPIRED

public static final int CREDENTIALS_EXPIRED
Expired credentials detected error.
Field Value:
8

DEFECTIVE_CREDENTIAL

public static final int DEFECTIVE_CREDENTIAL
Defective credential error.
Field Value:
9

DEFECTIVE_TOKEN

public static final int DEFECTIVE_TOKEN
Defective token error.
Field Value:
10

DUPLICATE_ELEMENT

public static final int DUPLICATE_ELEMENT
Duplicate credential element requested error.
Field Value:
17

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.
Field Value:
19

FAILURE

public static final int FAILURE
General failure, unspecified at GSS-API level.
Field Value:
11

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.
Field Value:
22

NAME_NOT_MN

public static final int NAME_NOT_MN
Name contains multi-mechanism elements error.
Field Value:
18

NO_CONTEXT

public static final int NO_CONTEXT
Invalid security context error.
Field Value:
12

NO_CRED

public static final int NO_CRED
Invalid credentials error.
Field Value:
13

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.
Field Value:
20

UNAUTHORIZED

public static final int UNAUTHORIZED
Operation unauthorized error.
Field Value:
15

UNAVAILABLE

public static final int UNAVAILABLE
Operation unavailable error.
Field Value:
16

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.
Field Value:
21

Constructor Details

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 Details

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 Throwable.getMessage(). It is customary in Java to use this method to obtain exception information.
Overrides:
getMessage in interface Throwable
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.
Overrides:
toString in interface Throwable
Returns:
The textual representation.

GSSException.java -- a general exception in GSS. Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. The documentation comments of this class are derived from the text of RFC 2853: Generic Security Service API Version 2: Java Bindings. That document is covered under the following license notice: Copyright (C) The Internet Society (2000). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.