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.store; 021 022 023import java.util.Map; 024 025import javax.security.auth.kerberos.KerberosPrincipal; 026 027import org.apache.directory.shared.kerberos.KerberosTime; 028import org.apache.directory.shared.kerberos.codec.types.EncryptionType; 029import org.apache.directory.shared.kerberos.codec.types.SamType; 030import org.apache.directory.shared.kerberos.components.EncryptionKey; 031 032 033/** 034 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 035 */ 036public class PrincipalStoreEntry 037{ 038 // principal 039 private String distinguishedName; 040 private KerberosPrincipal principal; 041 042 // KDCEntry 043 private int keyVersionNumber; 044 private SamType samType; 045 046 private boolean disabled; 047 private boolean lockedOut; 048 private KerberosTime expiration; 049 050 private Map<EncryptionType, EncryptionKey> keyMap; 051 052 053 PrincipalStoreEntry( String distinguishedName, KerberosPrincipal principal, 054 int keyVersionNumber, 055 Map<EncryptionType, EncryptionKey> keyMap, SamType samType, 056 boolean disabled, boolean lockedOut, KerberosTime expiration ) 057 { 058 this.distinguishedName = distinguishedName; 059 this.principal = principal; 060 this.keyVersionNumber = keyVersionNumber; 061 this.disabled = disabled; 062 this.lockedOut = lockedOut; 063 this.expiration = expiration; 064 this.samType = samType; 065 this.keyMap = keyMap; 066 } 067 068 069 /** 070 * Returns whether this account is disabled. 071 * 072 * @return Whether this account is disabled. 073 */ 074 public boolean isDisabled() 075 { 076 return disabled; 077 } 078 079 080 /** 081 * Returns whether this account is locked-out. 082 * 083 * @return Whether this account is locked-out. 084 */ 085 public boolean isLockedOut() 086 { 087 return lockedOut; 088 } 089 090 091 /** 092 * Returns the expiration time. 093 * 094 * @return The expiration time. 095 */ 096 public KerberosTime getExpiration() 097 { 098 return expiration; 099 } 100 101 102 /** 103 * Returns the distinguished name. 104 * 105 * @return The distinguished name. 106 */ 107 public String getDistinguishedName() 108 { 109 return distinguishedName; 110 } 111 112 113 /** 114 * Returns the key map. 115 * 116 * @return The key map. 117 */ 118 public Map<EncryptionType, EncryptionKey> getKeyMap() 119 { 120 return keyMap; 121 } 122 123 124 /** 125 * Returns the key version number (kvno). 126 * 127 * @return The key version number (kvno). 128 */ 129 public int getKeyVersionNumber() 130 { 131 return keyVersionNumber; 132 } 133 134 135 /** 136 * Returns the principal. 137 * 138 * @return The principal. 139 */ 140 public KerberosPrincipal getPrincipal() 141 { 142 return principal; 143 } 144 145 146 /** 147 * Returns the single-use authentication (SAM) type. 148 * 149 * @return The single-use authentication (SAM) type. 150 */ 151 public SamType getSamType() 152 { 153 return samType; 154 } 155}