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