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.HostAddress;
27 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
28
29
30 /**
31 * Encrypted part of private messages.
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 EncKrbPrivPart extends KerberosMessage implements Encodable
37 {
38 private byte[] userData;
39 private KerberosTime timestamp; //optional
40 private Integer usec; //optional
41 private Integer sequenceNumber; //optional
42 private HostAddress senderAddress; //optional
43 private HostAddress recipientAddress; //optional
44
45
46 /**
47 * Creates a new instance of EncKrbPrivPart.
48 *
49 * @param userData
50 * @param timestamp
51 * @param usec
52 * @param sequenceNumber
53 * @param senderAddress
54 * @param recipientAddress
55 */
56 public EncKrbPrivPart( byte[] userData, KerberosTime timestamp, Integer usec, Integer sequenceNumber,
57 HostAddress senderAddress, HostAddress recipientAddress )
58 {
59 super( KerberosMessageType.ENC_PRIV_PART );
60
61 this.userData = userData;
62 this.timestamp = timestamp;
63 this.usec = usec;
64 this.sequenceNumber = sequenceNumber;
65 this.senderAddress = senderAddress;
66 this.recipientAddress = recipientAddress;
67 }
68
69
70 /**
71 * Returns the recipient {@link HostAddress}.
72 *
73 * @return The recipient {@link HostAddress}.
74 */
75 public HostAddress getRecipientAddress()
76 {
77 return recipientAddress;
78 }
79
80
81 /**
82 * Returns the sender {@link HostAddress}.
83 *
84 * @return The sender {@link HostAddress}.
85 */
86 public HostAddress getSenderAddress()
87 {
88 return senderAddress;
89 }
90
91
92 /**
93 * Returns the sequence number.
94 *
95 * @return The sequence number.
96 */
97 public Integer getSequenceNumber()
98 {
99 return sequenceNumber;
100 }
101
102
103 /**
104 * Returns the {@link KerberosTime} timestamp.
105 *
106 * @return The {@link KerberosTime} timestamp.
107 */
108 public KerberosTime getTimestamp()
109 {
110 return timestamp;
111 }
112
113
114 /**
115 * Returns the microsecond.
116 *
117 * @return The microsecond.
118 */
119 public Integer getMicroSecond()
120 {
121 return usec;
122 }
123
124
125 /**
126 * Returns the user data.
127 *
128 * @return The user data.
129 */
130 public byte[] getUserData()
131 {
132 return userData;
133 }
134 }