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.components;
21
22
23 import org.apache.directory.server.kerberos.shared.KerberosMessageType;
24 import org.apache.directory.server.kerberos.shared.messages.Encodable;
25 import org.apache.directory.server.kerberos.shared.messages.KerberosMessage;
26 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
27 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
28
29
30 /**
31 * Encrypted part of the application response.
32 *
33 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
34 * @version $Rev: 589780 $, $Date: 2007-10-29 19:14:59 +0100 (Mo, 29 Okt 2007) $
35 */
36 public class EncApRepPart extends KerberosMessage implements Encodable
37 {
38 private KerberosTime clientTime;
39 private int cusec;
40 private EncryptionKey subSessionKey; //optional
41 private Integer sequenceNumber; //optional
42
43
44 /**
45 * Creates a new instance of EncApRepPart.
46 *
47 * @param clientTime
48 * @param cusec
49 * @param subSessionKey
50 * @param sequenceNumber
51 */
52 public EncApRepPart( KerberosTime clientTime, int cusec, EncryptionKey subSessionKey, Integer sequenceNumber )
53 {
54 super( KerberosMessageType.ENC_AP_REP_PART );
55
56 this.clientTime = clientTime;
57 this.cusec = cusec;
58 this.subSessionKey = subSessionKey;
59 this.sequenceNumber = sequenceNumber;
60 }
61
62
63 /**
64 * Returns the client {@link KerberosTime}.
65 *
66 * @return The client {@link KerberosTime}.
67 */
68 public KerberosTime getClientTime()
69 {
70 return clientTime;
71 }
72
73
74 /**
75 * Returns the client microsecond.
76 *
77 * @return The client microsecond.
78 */
79 public int getClientMicroSecond()
80 {
81 return cusec;
82 }
83
84
85 /**
86 * Returns the sequence number.
87 *
88 * @return The sequence number.
89 */
90 public Integer getSequenceNumber()
91 {
92 return sequenceNumber;
93 }
94
95
96 /**
97 * Returns the sub-session {@link EncryptionKey}.
98 *
99 * @return The sub-session {@link EncryptionKey}.
100 */
101 public EncryptionKey getSubSessionKey()
102 {
103 return subSessionKey;
104 }
105 }