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 javax.security.auth.kerberos.KerberosPrincipal;
24
25 import org.apache.directory.server.kerberos.shared.messages.value.flags.TicketFlags;
26
27
28 /**
29 * Kerberos credential information.
30 *
31 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
32 * @version $Rev: 591019 $, $Date: 2007-11-01 15:16:34 +0100 (Do, 01 Nov 2007) $
33 */
34 public class KrbCredInfo
35 {
36 private EncryptionKey key;
37 private KerberosPrincipal clientPrincipal; //optional
38 private TicketFlags flags; //optional
39 private KerberosTime authTime; //optional
40 private KerberosTime startTime; //optional
41 private KerberosTime endTime; //optional
42 private KerberosTime renewTill; //optional
43 private KerberosPrincipal serverPrincipal; //optional
44 private HostAddresses clientAddresses; //optional
45
46
47 /**
48 * Creates a new instance of KrbCredInfo.
49 *
50 * @param key
51 * @param clientPrincipal
52 * @param flags
53 * @param authTime
54 * @param startTime
55 * @param endTime
56 * @param renewTill
57 * @param serverPrincipal
58 * @param clientAddresses
59 */
60 public KrbCredInfo( EncryptionKey key, KerberosPrincipal clientPrincipal, TicketFlags flags, KerberosTime authTime,
61 KerberosTime startTime, KerberosTime endTime, KerberosTime renewTill, KerberosPrincipal serverPrincipal,
62 HostAddresses clientAddresses )
63 {
64 this.key = key;
65 this.clientPrincipal = clientPrincipal;
66 this.flags = flags;
67 this.authTime = authTime;
68 this.startTime = startTime;
69 this.endTime = endTime;
70 this.renewTill = renewTill;
71 this.serverPrincipal = serverPrincipal;
72 this.clientAddresses = clientAddresses;
73 }
74
75
76 /**
77 * Returns the auth {@link KerberosTime}.
78 *
79 * @return The auth {@link KerberosTime}.
80 */
81 public KerberosTime getAuthTime()
82 {
83 return authTime;
84 }
85
86
87 /**
88 * Returns the client {@link HostAddresses}.
89 *
90 * @return The client {@link HostAddresses}.
91 */
92 public HostAddresses getClientAddresses()
93 {
94 return clientAddresses;
95 }
96
97
98 /**
99 * Returns the end {@link KerberosTime}.
100 *
101 * @return The end {@link KerberosTime}.
102 */
103 public KerberosTime getEndTime()
104 {
105 return endTime;
106 }
107
108
109 /**
110 * Returns the {@link TicketFlags}.
111 *
112 * @return The {@link TicketFlags}.
113 */
114 public TicketFlags getFlags()
115 {
116 return flags;
117 }
118
119
120 /**
121 * Returns the {@link EncryptionKey}.
122 *
123 * @return The {@link EncryptionKey}.
124 */
125 public EncryptionKey getKey()
126 {
127 return key;
128 }
129
130
131 /**
132 * Returns the client {@link KerberosPrincipal}.
133 *
134 * @return The client {@link KerberosPrincipal}.
135 */
136 public KerberosPrincipal getClientPrincipal()
137 {
138 return clientPrincipal;
139 }
140
141
142 /**
143 * Returns the renew till {@link KerberosTime}.
144 *
145 * @return The renew till {@link KerberosTime}.
146 */
147 public KerberosTime getRenewTill()
148 {
149 return renewTill;
150 }
151
152
153 /**
154 * Returns the server {@link KerberosPrincipal}.
155 *
156 * @return The server {@link KerberosPrincipal}.
157 */
158 public KerberosPrincipal getServerPrincipal()
159 {
160 return serverPrincipal;
161 }
162
163
164 /**
165 * Returns the start {@link KerberosTime}.
166 *
167 * @return The start {@link KerberosTime}.
168 */
169 public KerberosTime getStartTime()
170 {
171 return startTime;
172 }
173 }