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.components;
021    
022    
023    import org.apache.directory.server.kerberos.shared.KerberosMessageType;
024    import org.apache.directory.server.kerberos.shared.messages.Encodable;
025    import org.apache.directory.server.kerberos.shared.messages.KerberosMessage;
026    import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
027    import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
028    
029    
030    /**
031     * Encrypted part of the application response.
032     * 
033     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
034     * @version $Rev: 589780 $, $Date: 2007-10-29 19:14:59 +0100 (Mon, 29 Oct 2007) $
035     */
036    public class EncApRepPart extends KerberosMessage implements Encodable
037    {
038        private KerberosTime clientTime;
039        private int cusec;
040        private EncryptionKey subSessionKey; //optional
041        private Integer sequenceNumber; //optional
042    
043    
044        /**
045         * Creates a new instance of EncApRepPart.
046         *
047         * @param clientTime
048         * @param cusec
049         * @param subSessionKey
050         * @param sequenceNumber
051         */
052        public EncApRepPart( KerberosTime clientTime, int cusec, EncryptionKey subSessionKey, Integer sequenceNumber )
053        {
054            super( KerberosMessageType.ENC_AP_REP_PART );
055    
056            this.clientTime = clientTime;
057            this.cusec = cusec;
058            this.subSessionKey = subSessionKey;
059            this.sequenceNumber = sequenceNumber;
060        }
061    
062    
063        /**
064         * Returns the client {@link KerberosTime}.
065         *
066         * @return The client {@link KerberosTime}.
067         */
068        public KerberosTime getClientTime()
069        {
070            return clientTime;
071        }
072    
073    
074        /**
075         * Returns the client microsecond.
076         *
077         * @return The client microsecond.
078         */
079        public int getClientMicroSecond()
080        {
081            return cusec;
082        }
083    
084    
085        /**
086         * Returns the sequence number.
087         *
088         * @return The sequence number.
089         */
090        public Integer getSequenceNumber()
091        {
092            return sequenceNumber;
093        }
094    
095    
096        /**
097         * Returns the sub-session {@link EncryptionKey}.
098         *
099         * @return The sub-session {@link EncryptionKey}.
100         */
101        public EncryptionKey getSubSessionKey()
102        {
103            return subSessionKey;
104        }
105    }