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.keytab; 021 022 023 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey; 024 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime; 025 026 027 /** 028 * An entry within a keytab file. 029 * 030 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 031 * @version $Rev$, $Date$ 032 */ 033 public class KeytabEntry 034 { 035 private String principalName; 036 037 private long principalType; 038 039 private KerberosTime timeStamp; 040 041 private byte keyVersion; 042 043 private EncryptionKey key; 044 045 046 /** 047 * Creates a new instance of Entry. 048 * 049 * @param principalName 050 * @param principalType 051 * @param timeStamp 052 * @param keyVersion 053 * @param key 054 */ 055 public KeytabEntry( String principalName, long principalType, KerberosTime timeStamp, byte keyVersion, 056 EncryptionKey key ) 057 { 058 this.principalName = principalName; 059 this.principalType = principalType; 060 this.timeStamp = timeStamp; 061 this.keyVersion = keyVersion; 062 this.key = key; 063 } 064 065 066 /** 067 * @return The key. 068 */ 069 public EncryptionKey getKey() 070 { 071 return key; 072 } 073 074 075 /** 076 * @return The keyVersion. 077 */ 078 public byte getKeyVersion() 079 { 080 return keyVersion; 081 } 082 083 084 /** 085 * @return The principalName. 086 */ 087 public String getPrincipalName() 088 { 089 return principalName; 090 } 091 092 093 /** 094 * @return The principalType. 095 */ 096 public long getPrincipalType() 097 { 098 return principalType; 099 } 100 101 102 /** 103 * @return The timeStamp. 104 */ 105 public KerberosTime getTimeStamp() 106 { 107 return timeStamp; 108 } 109 }