KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > util > csiv2 > struct > SasStruct


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: SasStruct.java,v 1.1 2004/12/13 16:24:13 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.carol.util.csiv2.struct;
26
27 import java.io.Serializable JavaDoc;
28
29 import org.objectweb.carol.util.csiv2.gss.GSSHelper;
30
31 /**
32  * Cannot extends final class SAS_ContextSec
33  * @author Florent Benoit
34  */

35 public class SasStruct implements Serializable JavaDoc {
36
37     /**
38      * Target supports for this mech
39      */

40     private short targetSupports = 0;
41
42     /**
43      * Target requires for this mech
44      */

45     private short targetRequires = 0;
46
47     /**
48      * Identity types supported
49      */

50     private int supportedIdentityTypes = 0;
51
52     /**
53      * Naming mechanisms supported
54      */

55     private byte[][] supportedNamingMechanisms = new byte[0][0];
56
57     /**
58      * @return the targetRequires.
59      */

60     public short getTargetRequires() {
61         return targetRequires;
62     }
63
64     /**
65      * @param targetRequires The targetRequires to set.
66      */

67     public void setTargetRequires(int targetRequires) {
68         this.targetRequires = (short) targetRequires;
69     }
70
71     /**
72      * @return Returns the targetSupports.
73      */

74     public short getTargetSupports() {
75         return targetSupports;
76     }
77
78     /**
79      * @param targetSupports The targetSupports to set.
80      */

81     public void setTargetSupports(int targetSupports) {
82         this.targetSupports = (short) targetSupports;
83     }
84
85     /**
86      * @return Returns the supportedIdentityTypes.
87      */

88     public int getSupportedIdentityTypes() {
89         return supportedIdentityTypes;
90     }
91
92     /**
93      * @param supportedIdentityTypes The supportedIdentityTypes to set.
94      */

95     public void setSupportedIdentityTypes(int supportedIdentityTypes) {
96         this.supportedIdentityTypes = supportedIdentityTypes;
97     }
98
99     /**
100      * @return Returns the supportedNamingMechanisms.
101      */

102     public byte[][] getSupportedNamingMechanisms() {
103         return supportedNamingMechanisms;
104     }
105
106     /**
107      */

108     public void enableGSSUPSupportedNamingMechanisms() {
109
110         /**
111          * A target that supports identity assertion shall include in its IORs
112          * the complete list of GSS mechanisms for which it supports identity
113          * assertions using an identity token of type ITTPrincipalName.
114          */

115
116         byte[] gssupDerEncoding = GSSHelper.getMechOidDer();
117
118         // One supported (GSSUP)
119
this.supportedNamingMechanisms = new byte[1][gssupDerEncoding.length];
120
121         // Copy encoding DER of GSSUP Oid in first index of the array of one element
122
System.arraycopy(gssupDerEncoding, 0, this.supportedNamingMechanisms[0], 0, gssupDerEncoding.length);
123
124     }
125
126 }
Popular Tags