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.keytab;
21
22
23 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
24 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
25
26
27 /**
28 * An entry within a keytab file.
29 *
30 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
31 * @version $Rev$, $Date$
32 */
33 public class KeytabEntry
34 {
35 private String principalName;
36
37 private long principalType;
38
39 private KerberosTime timeStamp;
40
41 private byte keyVersion;
42
43 private EncryptionKey key;
44
45
46 /**
47 * Creates a new instance of Entry.
48 *
49 * @param principalName
50 * @param principalType
51 * @param timeStamp
52 * @param keyVersion
53 * @param key
54 */
55 public KeytabEntry( String principalName, long principalType, KerberosTime timeStamp, byte keyVersion,
56 EncryptionKey key )
57 {
58 this.principalName = principalName;
59 this.principalType = principalType;
60 this.timeStamp = timeStamp;
61 this.keyVersion = keyVersion;
62 this.key = key;
63 }
64
65
66 /**
67 * @return The key.
68 */
69 public EncryptionKey getKey()
70 {
71 return key;
72 }
73
74
75 /**
76 * @return The keyVersion.
77 */
78 public byte getKeyVersion()
79 {
80 return keyVersion;
81 }
82
83
84 /**
85 * @return The principalName.
86 */
87 public String getPrincipalName()
88 {
89 return principalName;
90 }
91
92
93 /**
94 * @return The principalType.
95 */
96 public long getPrincipalType()
97 {
98 return principalType;
99 }
100
101
102 /**
103 * @return The timeStamp.
104 */
105 public KerberosTime getTimeStamp()
106 {
107 return timeStamp;
108 }
109 }