001    /*
002     *  Licensed to the Apache Software Foundation (ASF) under one
003     *  or more contributor license agreements.  See the NOTICE file
004     *  distributed with this work for additional information
005     *  regarding copyright ownership.  The ASF licenses this file
006     *  to you under the Apache License, Version 2.0 (the
007     *  "License"); you may not use this file except in compliance
008     *  with the License.  You may obtain a copy of the License at
009     *  
010     *    http://www.apache.org/licenses/LICENSE-2.0
011     *  
012     *  Unless required by applicable law or agreed to in writing,
013     *  software distributed under the License is distributed on an
014     *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     *  KIND, either express or implied.  See the License for the
016     *  specific language governing permissions and limitations
017     *  under the License. 
018     *  
019     */
020    package org.apache.directory.server.kerberos.shared.messages.value;
021    
022    
023    import java.util.Set;
024    
025    import javax.security.auth.kerberos.KerberosPrincipal;
026    
027    import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
028    import org.apache.directory.server.kerberos.shared.messages.components.Ticket;
029    
030    
031    /**
032     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
033     * @version $Rev: 590715 $, $Date: 2007-10-31 16:23:32 +0100 (Wed, 31 Oct 2007) $
034     */
035    public class RequestBody
036    {
037        private KdcOptions kdcOptions;
038        private KerberosPrincipal clientPrincipal; //optional in TgsReq only
039        private KerberosPrincipal serverPrincipal;
040        private KerberosTime from; //optional
041        private KerberosTime till;
042        private KerberosTime rtime; //optional
043        private int nonce;
044        private Set<EncryptionType> eType;
045        private HostAddresses addresses; //optional
046        private EncryptedData encAuthorizationData; //optional
047        private Ticket[] additionalTickets; //optional
048    
049    
050        /**
051         * Creates a new instance of RequestBody.
052         *
053         * @param kdcOptions
054         * @param clientPrincipal
055         * @param serverPrincipal
056         * @param from
057         * @param till
058         * @param rtime
059         * @param nonce
060         * @param eType
061         * @param addresses
062         * @param encAuthorizationData
063         * @param additionalTickets
064         */
065        public RequestBody( KdcOptions kdcOptions, KerberosPrincipal clientPrincipal, KerberosPrincipal serverPrincipal,
066            KerberosTime from, KerberosTime till, KerberosTime rtime, int nonce, Set<EncryptionType> eType,
067            HostAddresses addresses, EncryptedData encAuthorizationData, Ticket[] additionalTickets )
068        {
069            this.kdcOptions = kdcOptions;
070            this.clientPrincipal = clientPrincipal;
071            this.serverPrincipal = serverPrincipal;
072            this.from = from;
073            this.till = till;
074            this.rtime = rtime;
075            this.nonce = nonce;
076            this.eType = eType;
077            this.addresses = addresses;
078            this.encAuthorizationData = encAuthorizationData;
079            this.additionalTickets = additionalTickets;
080        }
081    
082    
083        /**
084         * Returns the additional {@link Ticket}s.
085         *
086         * @return The additional {@link Ticket}s.
087         */
088        public Ticket[] getAdditionalTickets()
089        {
090            return additionalTickets;
091        }
092    
093    
094        /**
095         * Returns the {@link HostAddresses}.
096         *
097         * @return The {@link HostAddresses}.
098         */
099        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    }