1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.server.kerberos.kdc;
21
22
23 import java.net.InetAddress;
24
25 import org.apache.directory.server.kerberos.KerberosConfig;
26 import org.apache.directory.server.kerberos.shared.crypto.encryption.CipherTextHandler;
27 import org.apache.directory.server.kerberos.shared.replay.ReplayCache;
28 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
29 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
30 import org.apache.directory.shared.kerberos.components.KdcReq;
31 import org.apache.directory.shared.kerberos.messages.KerberosMessage;
32
33
34
35
36
37
38
39
40 public abstract class KdcContext
41 {
42 private static final long serialVersionUID = 6490030984626825108L;
43
44
45 private KerberosConfig config;
46 private PrincipalStore store;
47
48
49 private KdcReq request;
50
51
52 private KerberosMessage reply;
53
54
55 private InetAddress clientAddress;
56 private CipherTextHandler cipherTextHandler;
57
58
59 private EncryptionType encryptionType;
60
61
62 private ReplayCache replayCache;
63
64
65
66
67 public KerberosConfig getConfig()
68 {
69 return config;
70 }
71
72
73
74
75
76 public void setConfig( KerberosConfig config )
77 {
78 this.config = config;
79 }
80
81
82
83
84
85 public PrincipalStore getStore()
86 {
87 return store;
88 }
89
90
91
92
93
94 public void setStore( PrincipalStore store )
95 {
96 this.store = store;
97 }
98
99
100
101
102
103 public KdcReq getRequest()
104 {
105 return request;
106 }
107
108
109
110
111
112 public void setRequest( KdcReq request )
113 {
114 this.request = request;
115 }
116
117
118
119
120
121 public KerberosMessage getReply()
122 {
123 return reply;
124 }
125
126
127
128
129
130 public void setReply( KerberosMessage reply )
131 {
132 this.reply = reply;
133 }
134
135
136
137
138
139 public InetAddress getClientAddress()
140 {
141 return clientAddress;
142 }
143
144
145
146
147
148 public void setClientAddress( InetAddress clientAddress )
149 {
150 this.clientAddress = clientAddress;
151 }
152
153
154
155
156
157 public CipherTextHandler getCipherTextHandler()
158 {
159 return cipherTextHandler;
160 }
161
162
163
164
165
166 public void setCipherTextHandler( CipherTextHandler cipherTextHandler )
167 {
168 this.cipherTextHandler = cipherTextHandler;
169 }
170
171
172
173
174
175
176
177 public EncryptionType getEncryptionType()
178 {
179 return encryptionType;
180 }
181
182
183
184
185
186
187
188 public void setEncryptionType( EncryptionType encryptionType )
189 {
190 this.encryptionType = encryptionType;
191 }
192
193
194
195
196
197 public String toString()
198 {
199 StringBuilder sb = new StringBuilder();
200
201 sb.append( "Req : " ).append( request.toString( " " ) );
202 sb.append( "Client address : " ).append( clientAddress );
203
204 if ( encryptionType != null )
205 {
206 sb.append( '\n' );
207 sb.append( "EncryptionType : " ).append( encryptionType );
208 }
209
210 return sb.toString();
211 }
212
213
214
215
216
217
218
219 public void setReplayCache( ReplayCache replayCache )
220 {
221 this.replayCache = replayCache;
222 }
223
224
225
226
227
228 public ReplayCache getReplayCache()
229 {
230 return replayCache;
231 }
232 }