| 1 |
/* |
| 2 |
* Copyright 1999-2010 University of Chicago |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in |
| 5 |
* compliance with the License. You may obtain a copy of the License at |
| 6 |
* |
| 7 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
* |
| 9 |
* Unless required by applicable law or agreed to in writing, software distributed under the License is |
| 10 |
* distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 11 |
* express or implied. |
| 12 |
* |
| 13 |
* See the License for the specific language governing permissions and limitations under the License. |
| 14 |
*/ |
| 15 |
package org.gridforum.jgss; |
| 16 |
|
| 17 |
import org.ietf.jgss.GSSCredential; |
| 18 |
import org.ietf.jgss.GSSException; |
| 19 |
import org.ietf.jgss.Oid; |
| 20 |
|
| 21 |
/** |
| 22 |
* Defines Java API for credential export extension as defined in the |
| 23 |
* <a href="http://www.gridforum.org/security/gsi/draft-ggf-gss-extensions-08.pdf">GSS-API Extensions document</a>. |
| 24 |
* Some of the functions might not specify all the parameters as in the document. |
| 25 |
* <BR><BR>Notes: |
| 26 |
* <UL> |
| 27 |
* <LI>Protection key is currently not supported.</LI> |
| 28 |
* </UL> |
| 29 |
*/ |
| 30 |
public interface ExtendedGSSCredential extends GSSCredential { |
| 31 |
|
| 32 |
public static final int |
| 33 |
IMPEXP_OPAQUE = 0, |
| 34 |
IMPEXP_MECH_SPECIFIC = 1; |
| 35 |
|
| 36 |
/** |
| 37 |
* Exports this credential so that another process might import it. |
| 38 |
* The exported credential might be imported again using the |
| 39 |
* {@link ExtendedGSSManager#createCredential(byte[], int, int, Oid, int) |
| 40 |
* ExtendedGSSManager.createCredential} method. |
| 41 |
* |
| 42 |
* @param option |
| 43 |
* The export type. If set to {@link ExtendedGSSCredential#IMPEXP_OPAQUE |
| 44 |
* ExtendedGSSCredential.IMPEXP_OPAQUE} exported buffer is an opaque |
| 45 |
* buffer suitable for storage in memory or on disk or passing to |
| 46 |
* another process. If set to {@link ExtendedGSSCredential#IMPEXP_MECH_SPECIFIC |
| 47 |
* ExtendedGSSCredential.IMPEXP_MECH_SPECIFIC} exported buffer is a |
| 48 |
* buffer filled with mechanism-specific information that the calling |
| 49 |
* application can use to pass the credential to another process that |
| 50 |
* is not written to the GSS-API. |
| 51 |
* @return The buffer containing the credential |
| 52 |
* @exception GSSException containing the following major error codes: |
| 53 |
* <code>GSSException.CREDENTIAL_EXPIRED, |
| 54 |
* GSSException.UNAVAILABLE, GSSException.FAILURE</code> |
| 55 |
*/ |
| 56 |
public byte[] export(int option) |
| 57 |
throws GSSException; |
| 58 |
|
| 59 |
/** |
| 60 |
* Exports this credential so that another process might import it. |
| 61 |
* The exported credential might be imported again using the |
| 62 |
* {@link ExtendedGSSManager#createCredential(byte[], int, int, Oid, int) |
| 63 |
* ExtendedGSSManager.createCredential} method. |
| 64 |
* |
| 65 |
* @param option |
| 66 |
* The export type. If set to {@link ExtendedGSSCredential#IMPEXP_OPAQUE |
| 67 |
* ExtendedGSSCredential.IMPEXP_OPAQUE} exported buffer is an opaque |
| 68 |
* buffer suitable for storage in memory or on disk or passing to |
| 69 |
* another process. If set to {@link ExtendedGSSCredential#IMPEXP_MECH_SPECIFIC |
| 70 |
* ExtendedGSSCredential.IMPEXP_MECH_SPECIFIC} exported buffer is a buffer |
| 71 |
* filled with mechanism-specific information that the calling application |
| 72 |
* can use to pass the credential to another process that is not written |
| 73 |
* to the GSS-API. |
| 74 |
* @param mech Desired mechanism for exported credential, may be null to |
| 75 |
* indicate system default. |
| 76 |
* @return The buffer containing the credential |
| 77 |
* @exception GSSException containing the following major error codes: |
| 78 |
* <code>GSSException.CREDENTIAL_EXPIRED, |
| 79 |
* GSSException.UNAVAILABLE, GSSException.BAD_MECH, GSSException.FAILURE</code> |
| 80 |
*/ |
| 81 |
public byte[] export(int option, Oid mech) |
| 82 |
throws GSSException; |
| 83 |
|
| 84 |
/** |
| 85 |
* Retrieves arbitrary data about this credential. |
| 86 |
* |
| 87 |
* @param oid the oid of the information desired. |
| 88 |
* @return the information desired. Might be null. |
| 89 |
* @exception GSSException containing the following major error codes: |
| 90 |
* <code>GSSException.FAILURE</code> |
| 91 |
*/ |
| 92 |
public Object inquireByOid(Oid oid) throws GSSException; |
| 93 |
} |