View Javadoc

1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *  
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *  
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License. 
18   *  
19   */
20  package org.apache.directory.server.kerberos.shared.messages.value;
21  
22  
23  import java.util.Set;
24  
25  import javax.security.auth.kerberos.KerberosPrincipal;
26  
27  import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
28  import org.apache.directory.server.kerberos.shared.messages.components.Ticket;
29  
30  
31  /**
32   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
33   * @version $Rev: 590715 $, $Date: 2007-10-31 16:23:32 +0100 (Mi, 31 Okt 2007) $
34   */
35  public class RequestBody
36  {
37      private KdcOptions kdcOptions;
38      private KerberosPrincipal clientPrincipal; //optional in TgsReq only
39      private KerberosPrincipal serverPrincipal;
40      private KerberosTime from; //optional
41      private KerberosTime till;
42      private KerberosTime rtime; //optional
43      private int nonce;
44      private Set<EncryptionType> eType;
45      private HostAddresses addresses; //optional
46      private EncryptedData encAuthorizationData; //optional
47      private Ticket[] additionalTickets; //optional
48  
49  
50      /**
51       * Creates a new instance of RequestBody.
52       *
53       * @param kdcOptions
54       * @param clientPrincipal
55       * @param serverPrincipal
56       * @param from
57       * @param till
58       * @param rtime
59       * @param nonce
60       * @param eType
61       * @param addresses
62       * @param encAuthorizationData
63       * @param additionalTickets
64       */
65      public RequestBody( KdcOptions kdcOptions, KerberosPrincipal clientPrincipal, KerberosPrincipal serverPrincipal,
66          KerberosTime from, KerberosTime till, KerberosTime rtime, int nonce, Set<EncryptionType> eType,
67          HostAddresses addresses, EncryptedData encAuthorizationData, Ticket[] additionalTickets )
68      {
69          this.kdcOptions = kdcOptions;
70          this.clientPrincipal = clientPrincipal;
71          this.serverPrincipal = serverPrincipal;
72          this.from = from;
73          this.till = till;
74          this.rtime = rtime;
75          this.nonce = nonce;
76          this.eType = eType;
77          this.addresses = addresses;
78          this.encAuthorizationData = encAuthorizationData;
79          this.additionalTickets = additionalTickets;
80      }
81  
82  
83      /**
84       * Returns the additional {@link Ticket}s.
85       *
86       * @return The additional {@link Ticket}s.
87       */
88      public Ticket[] getAdditionalTickets()
89      {
90          return additionalTickets;
91      }
92  
93  
94      /**
95       * Returns the {@link HostAddresses}.
96       *
97       * @return The {@link HostAddresses}.
98       */
99      public HostAddresses getAddresses()
100     {
101         return addresses;
102     }
103 
104 
105     /**
106      * Returns the client {@link KerberosPrincipal}.
107      *
108      * @return The client {@link KerberosPrincipal}.
109      */
110     public KerberosPrincipal getClientPrincipal()
111     {
112         return clientPrincipal;
113     }
114 
115 
116     /**
117      * Returns the server {@link KerberosPrincipal}.
118      *
119      * @return The server {@link KerberosPrincipal}.
120      */
121     public KerberosPrincipal getServerPrincipal()
122     {
123         return serverPrincipal;
124     }
125 
126 
127     /**
128      * Returns the encrypted {@link AuthorizationData} as {@link EncryptedData}.
129      *
130      * @return The encrypted {@link AuthorizationData} as {@link EncryptedData}.
131      */
132     public EncryptedData getEncAuthorizationData()
133     {
134         return encAuthorizationData;
135     }
136 
137 
138     /**
139      * Returns the requested {@link EncryptionType}s.
140      *
141      * @return The requested {@link EncryptionType}s.
142      */
143     public Set<EncryptionType> getEType()
144     {
145         return eType;
146     }
147 
148 
149     /**
150      * Returns the from {@link KerberosTime}.
151      *
152      * @return The from {@link KerberosTime}.
153      */
154     public KerberosTime getFrom()
155     {
156         return from;
157     }
158 
159 
160     /**
161      * Returns the {@link KdcOptions}.
162      *
163      * @return The {@link KdcOptions}.
164      */
165     public KdcOptions getKdcOptions()
166     {
167         return kdcOptions;
168     }
169 
170 
171     /**
172      * Returns the nonce.
173      *
174      * @return The nonce.
175      */
176     public int getNonce()
177     {
178         return nonce;
179     }
180 
181 
182     /**
183      * Returns the "R" {@link KerberosTime}.
184      *
185      * @return The "R" {@link KerberosTime}.
186      */
187     public KerberosTime getRtime()
188     {
189         return rtime;
190     }
191 
192 
193     /**
194      * Returns the till {@link KerberosTime}.
195      *
196      * @return The till {@link KerberosTime}.
197      */
198     public KerberosTime getTill()
199     {
200         return till;
201     }
202 }