KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > security > sas > GSSUPCredentialSpi


1 package org.jacorb.security.sas;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 2002-2004 Gerald Brose
7  *
8  * This library is free software; you can redistribute it and/or
9  * 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 JavaDoc;
24
25 import org.ietf.jgss.GSSCredential JavaDoc;
26 import org.ietf.jgss.GSSException JavaDoc;
27 import org.ietf.jgss.Oid JavaDoc;
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
42     private Provider JavaDoc myProvider = null;
43     private Oid JavaDoc myMechOid = null;
44     private GSSNameSpi name = null;
45     private int initLifetime;
46     private int acceptLifetime;
47     private int usage;
48
49     public GSSUPCredentialSpi (Provider JavaDoc myProvider, Oid JavaDoc myMechOid, GSSNameSpi name, int initLifetime, int acceptLifetime, int usage)
50     {
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 JavaDoc getProvider()
60     {
61         return myProvider;
62     }
63
64     public void dispose() throws GSSException JavaDoc
65     {
66         Provider JavaDoc myProvider = null;
67         Oid JavaDoc myMechOid = null;
68         GSSNameSpi name = null;
69     }
70
71     public GSSNameSpi getName() throws GSSException JavaDoc
72     {
73         return name;
74     }
75
76     public int getInitLifetime() throws GSSException JavaDoc
77     {
78         return initLifetime;
79     }
80
81     public int getAcceptLifetime() throws GSSException JavaDoc
82     {
83         return acceptLifetime;
84     }
85
86     public boolean isInitiatorCredential() throws GSSException JavaDoc
87     {
88         return (usage == GSSCredential.INITIATE_ONLY);
89     }
90
91     public boolean isAcceptorCredential() throws GSSException JavaDoc
92     {
93         return (usage == GSSCredential.ACCEPT_ONLY);
94     }
95
96     public Oid JavaDoc getMechanism()
97     {
98         return myMechOid;
99     }
100 }
101
Popular Tags