author | martin |
Tue, 15 Sep 2015 21:56:04 -0700 | |
changeset 32649 | 2ee9017c7597 |
parent 25859 | 3317bb8137f4 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
10336
0bb1999251f8
7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents:
5506
diff
changeset
|
2 |
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package sun.security.timestamp; |
|
27 |
||
28 |
import java.io.IOException; |
|
29 |
import sun.security.pkcs.PKCS7; |
|
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
30 |
import sun.security.util.Debug; |
2 | 31 |
import sun.security.util.DerValue; |
32 |
||
33 |
/** |
|
34 |
* This class provides the response corresponding to a timestamp request, |
|
35 |
* as defined in |
|
36 |
* <a href="http://www.ietf.org/rfc/rfc3161.txt">RFC 3161</a>. |
|
37 |
* |
|
38 |
* The TimeStampResp ASN.1 type has the following definition: |
|
39 |
* <pre> |
|
40 |
* |
|
41 |
* TimeStampResp ::= SEQUENCE { |
|
42 |
* status PKIStatusInfo, |
|
43 |
* timeStampToken TimeStampToken OPTIONAL ] |
|
44 |
* |
|
45 |
* PKIStatusInfo ::= SEQUENCE { |
|
46 |
* status PKIStatus, |
|
47 |
* statusString PKIFreeText OPTIONAL, |
|
48 |
* failInfo PKIFailureInfo OPTIONAL } |
|
49 |
* |
|
50 |
* PKIStatus ::= INTEGER { |
|
51 |
* granted (0), |
|
52 |
* -- when the PKIStatus contains the value zero a TimeStampToken, as |
|
53 |
* -- requested, is present. |
|
54 |
* grantedWithMods (1), |
|
55 |
* -- when the PKIStatus contains the value one a TimeStampToken, |
|
56 |
* -- with modifications, is present. |
|
57 |
* rejection (2), |
|
58 |
* waiting (3), |
|
59 |
* revocationWarning (4), |
|
60 |
* -- this message contains a warning that a revocation is |
|
61 |
* -- imminent |
|
62 |
* revocationNotification (5) |
|
63 |
* -- notification that a revocation has occurred } |
|
64 |
* |
|
65 |
* PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String |
|
66 |
* -- text encoded as UTF-8 String (note: each UTF8String SHOULD |
|
67 |
* -- include an RFC 1766 language tag to indicate the language |
|
68 |
* -- of the contained text) |
|
69 |
* |
|
70 |
* PKIFailureInfo ::= BIT STRING { |
|
71 |
* badAlg (0), |
|
72 |
* -- unrecognized or unsupported Algorithm Identifier |
|
73 |
* badRequest (2), |
|
74 |
* -- transaction not permitted or supported |
|
75 |
* badDataFormat (5), |
|
76 |
* -- the data submitted has the wrong format |
|
77 |
* timeNotAvailable (14), |
|
78 |
* -- the TSA's time source is not available |
|
79 |
* unacceptedPolicy (15), |
|
80 |
* -- the requested TSA policy is not supported by the TSA |
|
81 |
* unacceptedExtension (16), |
|
82 |
* -- the requested extension is not supported by the TSA |
|
83 |
* addInfoNotAvailable (17) |
|
84 |
* -- the additional information requested could not be understood |
|
85 |
* -- or is not available |
|
86 |
* systemFailure (25) |
|
87 |
* -- the request cannot be handled due to system failure } |
|
88 |
* |
|
89 |
* TimeStampToken ::= ContentInfo |
|
90 |
* -- contentType is id-signedData |
|
91 |
* -- content is SignedData |
|
92 |
* -- eContentType within SignedData is id-ct-TSTInfo |
|
93 |
* -- eContent within SignedData is TSTInfo |
|
94 |
* |
|
95 |
* </pre> |
|
96 |
* |
|
97 |
* @since 1.5 |
|
98 |
* @author Vincent Ryan |
|
99 |
* @see Timestamper |
|
100 |
*/ |
|
101 |
||
102 |
public class TSResponse { |
|
103 |
||
104 |
// Status codes (from RFC 3161) |
|
105 |
||
106 |
/** |
|
107 |
* The requested timestamp was granted. |
|
108 |
*/ |
|
109 |
public static final int GRANTED = 0; |
|
110 |
||
111 |
/** |
|
112 |
* The requested timestamp was granted with some modifications. |
|
113 |
*/ |
|
114 |
public static final int GRANTED_WITH_MODS = 1; |
|
115 |
||
116 |
/** |
|
117 |
* The requested timestamp was not granted. |
|
118 |
*/ |
|
119 |
public static final int REJECTION = 2; |
|
120 |
||
121 |
/** |
|
122 |
* The requested timestamp has not yet been processed. |
|
123 |
*/ |
|
124 |
public static final int WAITING = 3; |
|
125 |
||
126 |
/** |
|
127 |
* A warning that a certificate revocation is imminent. |
|
128 |
*/ |
|
129 |
public static final int REVOCATION_WARNING = 4; |
|
130 |
||
131 |
/** |
|
132 |
* Notification that a certificate revocation has occurred. |
|
133 |
*/ |
|
134 |
public static final int REVOCATION_NOTIFICATION = 5; |
|
135 |
||
136 |
// Failure codes (from RFC 3161) |
|
137 |
||
138 |
/** |
|
139 |
* Unrecognized or unsupported algorithm identifier. |
|
140 |
*/ |
|
141 |
public static final int BAD_ALG = 0; |
|
142 |
||
143 |
/** |
|
144 |
* The requested transaction is not permitted or supported. |
|
145 |
*/ |
|
146 |
public static final int BAD_REQUEST = 2; |
|
147 |
||
148 |
/** |
|
149 |
* The data submitted has the wrong format. |
|
150 |
*/ |
|
151 |
public static final int BAD_DATA_FORMAT = 5; |
|
152 |
||
153 |
/** |
|
154 |
* The TSA's time source is not available. |
|
155 |
*/ |
|
156 |
public static final int TIME_NOT_AVAILABLE = 14; |
|
157 |
||
158 |
/** |
|
159 |
* The requested TSA policy is not supported by the TSA. |
|
160 |
*/ |
|
161 |
public static final int UNACCEPTED_POLICY = 15; |
|
162 |
||
163 |
/** |
|
164 |
* The requested extension is not supported by the TSA. |
|
165 |
*/ |
|
166 |
public static final int UNACCEPTED_EXTENSION = 16; |
|
167 |
||
168 |
/** |
|
169 |
* The additional information requested could not be understood or is not |
|
170 |
* available. |
|
171 |
*/ |
|
172 |
public static final int ADD_INFO_NOT_AVAILABLE = 17; |
|
173 |
||
174 |
/** |
|
175 |
* The request cannot be handled due to system failure. |
|
176 |
*/ |
|
177 |
public static final int SYSTEM_FAILURE = 25; |
|
178 |
||
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
179 |
private static final Debug debug = Debug.getInstance("ts"); |
2 | 180 |
|
181 |
private int status; |
|
182 |
||
183 |
private String[] statusString = null; |
|
184 |
||
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
185 |
private boolean[] failureInfo = null; |
2 | 186 |
|
187 |
private byte[] encodedTsToken = null; |
|
188 |
||
189 |
private PKCS7 tsToken = null; |
|
190 |
||
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
191 |
private TimestampToken tstInfo; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
192 |
|
2 | 193 |
/** |
194 |
* Constructs an object to store the response to a timestamp request. |
|
195 |
* |
|
196 |
* @param status A buffer containing the ASN.1 BER encoded response. |
|
197 |
* @throws IOException The exception is thrown if a problem is encountered |
|
198 |
* parsing the timestamp response. |
|
199 |
*/ |
|
200 |
TSResponse(byte[] tsReply) throws IOException { |
|
201 |
parse(tsReply); |
|
202 |
} |
|
203 |
||
204 |
/** |
|
205 |
* Retrieve the status code returned by the TSA. |
|
206 |
*/ |
|
207 |
public int getStatusCode() { |
|
208 |
return status; |
|
209 |
} |
|
210 |
||
211 |
/** |
|
212 |
* Retrieve the status messages returned by the TSA. |
|
213 |
* |
|
214 |
* @return If null then no status messages were received. |
|
215 |
*/ |
|
216 |
public String[] getStatusMessages() { |
|
217 |
return statusString; |
|
218 |
} |
|
219 |
||
220 |
/** |
|
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
221 |
* Retrieve the failure info returned by the TSA. |
2 | 222 |
* |
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
223 |
* @return the failure info, or null if no failure code was received. |
2 | 224 |
*/ |
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
225 |
public boolean[] getFailureInfo() { |
2 | 226 |
return failureInfo; |
227 |
} |
|
228 |
||
229 |
public String getStatusCodeAsText() { |
|
230 |
||
231 |
switch (status) { |
|
232 |
case GRANTED: |
|
233 |
return "the timestamp request was granted."; |
|
234 |
||
235 |
case GRANTED_WITH_MODS: |
|
236 |
return |
|
237 |
"the timestamp request was granted with some modifications."; |
|
238 |
||
239 |
case REJECTION: |
|
240 |
return "the timestamp request was rejected."; |
|
241 |
||
242 |
case WAITING: |
|
243 |
return "the timestamp request has not yet been processed."; |
|
244 |
||
245 |
case REVOCATION_WARNING: |
|
246 |
return "warning: a certificate revocation is imminent."; |
|
247 |
||
248 |
case REVOCATION_NOTIFICATION: |
|
249 |
return "notification: a certificate revocation has occurred."; |
|
250 |
||
251 |
default: |
|
252 |
return ("unknown status code " + status + "."); |
|
253 |
} |
|
254 |
} |
|
255 |
||
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
256 |
private boolean isSet(int position) { |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
257 |
return failureInfo[position]; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
258 |
} |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
259 |
|
2 | 260 |
public String getFailureCodeAsText() { |
261 |
||
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
262 |
if (failureInfo == null) { |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
263 |
return ""; |
2 | 264 |
} |
265 |
||
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
266 |
try { |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
267 |
if (isSet(BAD_ALG)) |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
268 |
return "Unrecognized or unsupported algorithm identifier."; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
269 |
if (isSet(BAD_REQUEST)) |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
270 |
return "The requested transaction is not permitted or " + |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
271 |
"supported."; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
272 |
if (isSet(BAD_DATA_FORMAT)) |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
273 |
return "The data submitted has the wrong format."; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
274 |
if (isSet(TIME_NOT_AVAILABLE)) |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
275 |
return "The TSA's time source is not available."; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
276 |
if (isSet(UNACCEPTED_POLICY)) |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
277 |
return "The requested TSA policy is not supported by the TSA."; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
278 |
if (isSet(UNACCEPTED_EXTENSION)) |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
279 |
return "The requested extension is not supported by the TSA."; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
280 |
if (isSet(ADD_INFO_NOT_AVAILABLE)) |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
281 |
return "The additional information requested could not be " + |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
282 |
"understood or is not available."; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
283 |
if (isSet(SYSTEM_FAILURE)) |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
284 |
return "The request cannot be handled due to system failure."; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
285 |
} catch (ArrayIndexOutOfBoundsException ex) {} |
2 | 286 |
|
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
287 |
return ("unknown failure code"); |
2 | 288 |
} |
289 |
||
290 |
/** |
|
291 |
* Retrieve the timestamp token returned by the TSA. |
|
292 |
* |
|
293 |
* @return If null then no token was received. |
|
294 |
*/ |
|
295 |
public PKCS7 getToken() { |
|
296 |
return tsToken; |
|
297 |
} |
|
298 |
||
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
299 |
public TimestampToken getTimestampToken() { |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
300 |
return tstInfo; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
301 |
} |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
302 |
|
2 | 303 |
/** |
304 |
* Retrieve the ASN.1 BER encoded timestamp token returned by the TSA. |
|
305 |
* |
|
306 |
* @return If null then no token was received. |
|
307 |
*/ |
|
308 |
public byte[] getEncodedToken() { |
|
309 |
return encodedTsToken; |
|
310 |
} |
|
311 |
||
312 |
/* |
|
313 |
* Parses the timestamp response. |
|
314 |
* |
|
315 |
* @param status A buffer containing the ASN.1 BER encoded response. |
|
316 |
* @throws IOException The exception is thrown if a problem is encountered |
|
317 |
* parsing the timestamp response. |
|
318 |
*/ |
|
319 |
private void parse(byte[] tsReply) throws IOException { |
|
320 |
// Decode TimeStampResp |
|
321 |
||
322 |
DerValue derValue = new DerValue(tsReply); |
|
323 |
if (derValue.tag != DerValue.tag_Sequence) { |
|
324 |
throw new IOException("Bad encoding for timestamp response"); |
|
325 |
} |
|
326 |
||
327 |
// Parse status |
|
328 |
||
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
329 |
DerValue statusInfo = derValue.data.getDerValue(); |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
330 |
this.status = statusInfo.data.getInteger(); |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
331 |
if (debug != null) { |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
332 |
debug.println("timestamp response: status=" + this.status); |
2 | 333 |
} |
334 |
// Parse statusString, if present |
|
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
335 |
if (statusInfo.data.available() > 0) { |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
336 |
byte tag = (byte)statusInfo.data.peekByte(); |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
337 |
if (tag == DerValue.tag_SequenceOf) { |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
338 |
DerValue[] strings = statusInfo.data.getSequence(1); |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
339 |
statusString = new String[strings.length]; |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
340 |
for (int i = 0; i < strings.length; i++) { |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
341 |
statusString[i] = strings[i].getUTF8String(); |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
342 |
if (debug != null) { |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
343 |
debug.println("timestamp response: statusString=" + |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
344 |
statusString[i]); |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
345 |
} |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
346 |
} |
2 | 347 |
} |
348 |
} |
|
349 |
// Parse failInfo, if present |
|
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
350 |
if (statusInfo.data.available() > 0) { |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
351 |
this.failureInfo |
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
352 |
= statusInfo.data.getUnalignedBitString().toBooleanArray(); |
2 | 353 |
} |
354 |
||
355 |
// Parse timeStampToken, if present |
|
356 |
if (derValue.data.available() > 0) { |
|
357 |
DerValue timestampToken = derValue.data.getDerValue(); |
|
358 |
encodedTsToken = timestampToken.toByteArray(); |
|
359 |
tsToken = new PKCS7(encodedTsToken); |
|
10788
680a3dbfcaba
7102686: Restructure timestamp code so that jars and modules can more easily share the same code
mullan
parents:
10336
diff
changeset
|
360 |
tstInfo = new TimestampToken(tsToken.getContentInfo().getData()); |
2 | 361 |
} |
362 |
||
363 |
// Check the format of the timestamp response |
|
364 |
if (this.status == 0 || this.status == 1) { |
|
365 |
if (tsToken == null) { |
|
366 |
throw new TimestampException( |
|
367 |
"Bad encoding for timestamp response: " + |
|
368 |
"expected a timeStampToken element to be present"); |
|
369 |
} |
|
370 |
} else if (tsToken != null) { |
|
371 |
throw new TimestampException( |
|
372 |
"Bad encoding for timestamp response: " + |
|
373 |
"expected no timeStampToken element to be present"); |
|
374 |
} |
|
375 |
} |
|
376 |
||
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
25859
diff
changeset
|
377 |
static final class TimestampException extends IOException { |
10336
0bb1999251f8
7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents:
5506
diff
changeset
|
378 |
private static final long serialVersionUID = -1631631794891940953L; |
0bb1999251f8
7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents:
5506
diff
changeset
|
379 |
|
0bb1999251f8
7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents:
5506
diff
changeset
|
380 |
TimestampException(String message) { |
0bb1999251f8
7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents:
5506
diff
changeset
|
381 |
super(message); |
0bb1999251f8
7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents:
5506
diff
changeset
|
382 |
} |
2 | 383 |
} |
384 |
} |