01: package org.jacorb.security.sas;
02:
03: /*
04: * JacORB - a free Java ORB
05: *
06: * Copyright (C) 2002-2004 Gerald Brose
07: *
08: * This library is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Library General Public
10: * License as published by the Free Software Foundation; either
11: * version 2 of the License, or (at your option) any later version.
12: *
13: * This library is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * Library General Public License for more details.
17: *
18: * You should have received a copy of the GNU Library General Public
19: * License along with this library; if not, write to the Free
20: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21: */
22:
23: import java.security.Provider;
24:
25: import org.ietf.jgss.GSSCredential;
26: import org.ietf.jgss.GSSException;
27: import org.ietf.jgss.Oid;
28:
29: import sun.security.jgss.spi.GSSCredentialSpi;
30: import sun.security.jgss.spi.GSSNameSpi;
31:
32: /**
33: * This is the GSS-API Sercurity Provider Interface (SPI) for the GSSUP Credential
34: *
35: * @author David Robison
36: * @version $Id: GSSUPCredentialSpi.java,v 1.6 2004/05/06 12:40:01 nicolas Exp $
37: */
38:
39: public final class GSSUPCredentialSpi implements GSSCredentialSpi {
40:
41: private Provider myProvider = null;
42: private Oid myMechOid = null;
43: private GSSNameSpi name = null;
44: private int initLifetime;
45: private int acceptLifetime;
46: private int usage;
47:
48: public GSSUPCredentialSpi(Provider myProvider, Oid myMechOid,
49: GSSNameSpi name, int initLifetime, int acceptLifetime,
50: int usage) {
51: this .myProvider = myProvider;
52: this .myMechOid = myMechOid;
53: this .name = name;
54: this .initLifetime = initLifetime;
55: this .acceptLifetime = acceptLifetime;
56: this .usage = usage;
57: }
58:
59: public Provider getProvider() {
60: return myProvider;
61: }
62:
63: public void dispose() throws GSSException {
64: Provider myProvider = null;
65: Oid myMechOid = null;
66: GSSNameSpi name = null;
67: }
68:
69: public GSSNameSpi getName() throws GSSException {
70: return name;
71: }
72:
73: public int getInitLifetime() throws GSSException {
74: return initLifetime;
75: }
76:
77: public int getAcceptLifetime() throws GSSException {
78: return acceptLifetime;
79: }
80:
81: public boolean isInitiatorCredential() throws GSSException {
82: return (usage == GSSCredential.INITIATE_ONLY);
83: }
84:
85: public boolean isAcceptorCredential() throws GSSException {
86: return (usage == GSSCredential.ACCEPT_ONLY);
87: }
88:
89: public Oid getMechanism() {
90: return myMechOid;
91: }
92: }
|