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.kdc.authentication; 021 022 023 import org.apache.directory.server.kerberos.kdc.KdcContext; 024 import org.apache.directory.server.kerberos.shared.messages.components.Ticket; 025 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey; 026 import org.apache.directory.server.kerberos.shared.replay.ReplayCache; 027 import org.apache.directory.server.kerberos.shared.store.PrincipalStoreEntry; 028 029 030 /** 031 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 032 * @version $Rev: 642496 $, $Date: 2008-03-29 04:09:22 +0100 (Sat, 29 Mar 2008) $ 033 */ 034 public class AuthenticationContext extends KdcContext 035 { 036 private static final long serialVersionUID = -2249170923251265359L; 037 038 //private Map checksumEngines = new HashMap(); 039 040 private Ticket ticket; 041 private EncryptionKey clientKey; 042 private ReplayCache replayCache; 043 044 private PrincipalStoreEntry clientEntry; 045 private PrincipalStoreEntry serverEntry; 046 047 private boolean isPreAuthenticated; 048 049 050 /** 051 * @return Returns the serverEntry. 052 */ 053 public PrincipalStoreEntry getServerEntry() 054 { 055 return serverEntry; 056 } 057 058 059 /** 060 * @param serverEntry The serverEntry to set. 061 */ 062 public void setServerEntry( PrincipalStoreEntry serverEntry ) 063 { 064 this.serverEntry = serverEntry; 065 } 066 067 068 /** 069 * @return Returns the clientEntry. 070 */ 071 public PrincipalStoreEntry getClientEntry() 072 { 073 return clientEntry; 074 } 075 076 077 /** 078 * @param clientEntry The clientEntry to set. 079 */ 080 public void setClientEntry( PrincipalStoreEntry clientEntry ) 081 { 082 this.clientEntry = clientEntry; 083 } 084 085 086 /** 087 * @return Returns the checksumEngines. 088 * 089 public Map getChecksumEngines() 090 { 091 return checksumEngines; 092 } 093 */ 094 095 /** 096 * @param checksumEngines The checksumEngines to set. 097 * 098 public void setChecksumEngines( Map checksumEngines ) 099 { 100 this.checksumEngines = checksumEngines; 101 } 102 */ 103 104 105 /** 106 * @return Returns the replayCache. 107 */ 108 public ReplayCache getReplayCache() 109 { 110 return replayCache; 111 } 112 113 114 /** 115 * @param replayCache The replayCache to set. 116 */ 117 public void setReplayCache( ReplayCache replayCache ) 118 { 119 this.replayCache = replayCache; 120 } 121 122 123 /** 124 * @return Returns the clientKey. 125 */ 126 public EncryptionKey getClientKey() 127 { 128 return clientKey; 129 } 130 131 132 /** 133 * @param clientKey The clientKey to set. 134 */ 135 public void setClientKey( EncryptionKey clientKey ) 136 { 137 this.clientKey = clientKey; 138 } 139 140 141 /** 142 * @return Returns the ticket. 143 */ 144 public Ticket getTicket() 145 { 146 return ticket; 147 } 148 149 150 /** 151 * @param ticket The ticket to set. 152 */ 153 public void setTicket( Ticket ticket ) 154 { 155 this.ticket = ticket; 156 } 157 158 159 /** 160 * @return true if the client used pre-authentication. 161 */ 162 public boolean isPreAuthenticated() 163 { 164 return isPreAuthenticated; 165 } 166 167 168 /** 169 * @param isPreAuthenticated Whether the client used pre-authentication. 170 */ 171 public void setPreAuthenticated( boolean isPreAuthenticated ) 172 { 173 this.isPreAuthenticated = isPreAuthenticated; 174 } 175 }