author | darcy |
Thu, 29 Aug 2019 10:52:21 -0700 | |
changeset 57950 | 4612a3cfb927 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
57950
4612a3cfb927
8229999: Apply java.io.Serial annotations to security types in java.base
darcy
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2000, 2019, 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 java.security.cert; |
|
27 |
||
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
28 |
import java.io.InvalidObjectException; |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
29 |
import java.io.IOException; |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
30 |
import java.io.ObjectInputStream; |
2 | 31 |
import java.security.GeneralSecurityException; |
32 |
||
33 |
/** |
|
34 |
* An exception indicating one of a variety of problems encountered when |
|
35 |
* validating a certification path. |
|
36 |
* <p> |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
37 |
* A {@code CertPathValidatorException} provides support for wrapping |
2 | 38 |
* exceptions. The {@link #getCause getCause} method returns the throwable, |
39 |
* if any, that caused this exception to be thrown. |
|
40 |
* <p> |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
41 |
* A {@code CertPathValidatorException} may also include the |
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
42 |
* certification path that was being validated when the exception was thrown, |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
43 |
* the index of the certificate in the certification path that caused the |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
44 |
* exception to be thrown, and the reason that caused the failure. Use the |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
45 |
* {@link #getCertPath getCertPath}, {@link #getIndex getIndex}, and |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
46 |
* {@link #getReason getReason} methods to retrieve this information. |
2 | 47 |
* |
48 |
* <p> |
|
49 |
* <b>Concurrent Access</b> |
|
50 |
* <p> |
|
51 |
* Unless otherwise specified, the methods defined in this class are not |
|
52 |
* thread-safe. Multiple threads that need to access a single |
|
53 |
* object concurrently should synchronize amongst themselves and |
|
54 |
* provide the necessary locking. Multiple threads each manipulating |
|
55 |
* separate objects need not synchronize. |
|
56 |
* |
|
57 |
* @see CertPathValidator |
|
58 |
* |
|
59 |
* @since 1.4 |
|
60 |
* @author Yassir Elley |
|
61 |
*/ |
|
62 |
public class CertPathValidatorException extends GeneralSecurityException { |
|
63 |
||
57950
4612a3cfb927
8229999: Apply java.io.Serial annotations to security types in java.base
darcy
parents:
47216
diff
changeset
|
64 |
@java.io.Serial |
2 | 65 |
private static final long serialVersionUID = -3083180014971893139L; |
66 |
||
67 |
/** |
|
68 |
* @serial the index of the certificate in the certification path |
|
69 |
* that caused the exception to be thrown |
|
70 |
*/ |
|
71 |
private int index = -1; |
|
72 |
||
73 |
/** |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
74 |
* @serial the {@code CertPath} that was being validated when |
2 | 75 |
* the exception was thrown |
76 |
*/ |
|
77 |
private CertPath certPath; |
|
78 |
||
79 |
/** |
|
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
80 |
* @serial the reason the validation failed |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
81 |
*/ |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
82 |
private Reason reason = BasicReason.UNSPECIFIED; |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
83 |
|
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
84 |
/** |
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
85 |
* Creates a {@code CertPathValidatorException} with |
2 | 86 |
* no detail message. |
87 |
*/ |
|
88 |
public CertPathValidatorException() { |
|
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
89 |
this(null, null); |
2 | 90 |
} |
91 |
||
92 |
/** |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
93 |
* Creates a {@code CertPathValidatorException} with the given |
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
94 |
* detail message. A detail message is a {@code String} that |
2 | 95 |
* describes this particular exception. |
96 |
* |
|
97 |
* @param msg the detail message |
|
98 |
*/ |
|
99 |
public CertPathValidatorException(String msg) { |
|
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
100 |
this(msg, null); |
2 | 101 |
} |
102 |
||
103 |
/** |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
104 |
* Creates a {@code CertPathValidatorException} that wraps the |
2 | 105 |
* specified throwable. This allows any exception to be converted into a |
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
106 |
* {@code CertPathValidatorException}, while retaining information |
2 | 107 |
* about the wrapped exception, which may be useful for debugging. The |
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
108 |
* detail message is set to ({@code cause==null ? null : cause.toString()}) |
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
109 |
* (which typically contains the class and detail message of |
2 | 110 |
* cause). |
111 |
* |
|
112 |
* @param cause the cause (which is saved for later retrieval by the |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
113 |
* {@link #getCause getCause()} method). (A {@code null} value is |
2 | 114 |
* permitted, and indicates that the cause is nonexistent or unknown.) |
115 |
*/ |
|
116 |
public CertPathValidatorException(Throwable cause) { |
|
1569
54e1de48703e
6765046: CertPathValidatorException(Throwable).getMessage() always returns null since b37
mullan
parents:
1238
diff
changeset
|
117 |
this((cause == null ? null : cause.toString()), cause); |
2 | 118 |
} |
119 |
||
120 |
/** |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
121 |
* Creates a {@code CertPathValidatorException} with the specified |
2 | 122 |
* detail message and cause. |
123 |
* |
|
124 |
* @param msg the detail message |
|
125 |
* @param cause the cause (which is saved for later retrieval by the |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
126 |
* {@link #getCause getCause()} method). (A {@code null} value is |
2 | 127 |
* permitted, and indicates that the cause is nonexistent or unknown.) |
128 |
*/ |
|
129 |
public CertPathValidatorException(String msg, Throwable cause) { |
|
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
130 |
this(msg, cause, null, -1); |
2 | 131 |
} |
132 |
||
133 |
/** |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
134 |
* Creates a {@code CertPathValidatorException} with the specified |
2 | 135 |
* detail message, cause, certification path, and index. |
136 |
* |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
137 |
* @param msg the detail message (or {@code null} if none) |
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
138 |
* @param cause the cause (or {@code null} if none) |
2 | 139 |
* @param certPath the certification path that was in the process of |
140 |
* being validated when the error was encountered |
|
141 |
* @param index the index of the certificate in the certification path |
|
142 |
* that caused the error (or -1 if not applicable). Note that |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
143 |
* the list of certificates in a {@code CertPath} is zero based. |
2 | 144 |
* @throws IndexOutOfBoundsException if the index is out of range |
18156 | 145 |
* {@code (index < -1 || (certPath != null && index >= |
146 |
* certPath.getCertificates().size()) } |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
147 |
* @throws IllegalArgumentException if {@code certPath} is |
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
148 |
* {@code null} and {@code index} is not -1 |
2 | 149 |
*/ |
150 |
public CertPathValidatorException(String msg, Throwable cause, |
|
151 |
CertPath certPath, int index) { |
|
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
152 |
this(msg, cause, certPath, index, BasicReason.UNSPECIFIED); |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
153 |
} |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
154 |
|
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
155 |
/** |
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
156 |
* Creates a {@code CertPathValidatorException} with the specified |
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
157 |
* detail message, cause, certification path, index, and reason. |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
158 |
* |
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
159 |
* @param msg the detail message (or {@code null} if none) |
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
160 |
* @param cause the cause (or {@code null} if none) |
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
161 |
* @param certPath the certification path that was in the process of |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
162 |
* being validated when the error was encountered |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
163 |
* @param index the index of the certificate in the certification path |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
164 |
* that caused the error (or -1 if not applicable). Note that |
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
165 |
* the list of certificates in a {@code CertPath} is zero based. |
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
166 |
* @param reason the reason the validation failed |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
167 |
* @throws IndexOutOfBoundsException if the index is out of range |
18156 | 168 |
* {@code (index < -1 || (certPath != null && index >= |
169 |
* certPath.getCertificates().size()) } |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
170 |
* @throws IllegalArgumentException if {@code certPath} is |
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
171 |
* {@code null} and {@code index} is not -1 |
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
172 |
* @throws NullPointerException if {@code reason} is {@code null} |
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
173 |
* |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
174 |
* @since 1.7 |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
175 |
*/ |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
176 |
public CertPathValidatorException(String msg, Throwable cause, |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
177 |
CertPath certPath, int index, Reason reason) { |
2 | 178 |
super(msg, cause); |
179 |
if (certPath == null && index != -1) { |
|
180 |
throw new IllegalArgumentException(); |
|
181 |
} |
|
182 |
if (index < -1 || |
|
183 |
(certPath != null && index >= certPath.getCertificates().size())) { |
|
184 |
throw new IndexOutOfBoundsException(); |
|
185 |
} |
|
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
186 |
if (reason == null) { |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
187 |
throw new NullPointerException("reason can't be null"); |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
188 |
} |
2 | 189 |
this.certPath = certPath; |
190 |
this.index = index; |
|
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
191 |
this.reason = reason; |
2 | 192 |
} |
193 |
||
194 |
/** |
|
195 |
* Returns the certification path that was being validated when |
|
196 |
* the exception was thrown. |
|
197 |
* |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
198 |
* @return the {@code CertPath} that was being validated when |
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
199 |
* the exception was thrown (or {@code null} if not specified) |
2 | 200 |
*/ |
201 |
public CertPath getCertPath() { |
|
202 |
return this.certPath; |
|
203 |
} |
|
204 |
||
205 |
/** |
|
206 |
* Returns the index of the certificate in the certification path |
|
207 |
* that caused the exception to be thrown. Note that the list of |
|
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
208 |
* certificates in a {@code CertPath} is zero based. If no |
2 | 209 |
* index has been set, -1 is returned. |
210 |
* |
|
211 |
* @return the index that has been set, or -1 if none has been set |
|
212 |
*/ |
|
213 |
public int getIndex() { |
|
214 |
return this.index; |
|
215 |
} |
|
216 |
||
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
217 |
/** |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
218 |
* Returns the reason that the validation failed. The reason is |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
219 |
* associated with the index of the certificate returned by |
4512
b3ed7ecf8f55
6909563: Javadoc build warnings in rmi, security, management
darcy
parents:
1569
diff
changeset
|
220 |
* {@link #getIndex}. |
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
221 |
* |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
222 |
* @return the reason that the validation failed, or |
18551
882a3948c6e6
8017325: Cleanup of the javadoc <code> tag in java.security.cert
juh
parents:
18156
diff
changeset
|
223 |
* {@code BasicReason.UNSPECIFIED} if a reason has not been |
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
224 |
* specified |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
225 |
* |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
226 |
* @since 1.7 |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
227 |
*/ |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
228 |
public Reason getReason() { |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
229 |
return this.reason; |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
230 |
} |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
231 |
|
57950
4612a3cfb927
8229999: Apply java.io.Serial annotations to security types in java.base
darcy
parents:
47216
diff
changeset
|
232 |
@java.io.Serial |
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
233 |
private void readObject(ObjectInputStream stream) |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
234 |
throws ClassNotFoundException, IOException { |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
235 |
stream.defaultReadObject(); |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
236 |
if (reason == null) { |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
237 |
reason = BasicReason.UNSPECIFIED; |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
238 |
} |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
239 |
if (certPath == null && index != -1) { |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
240 |
throw new InvalidObjectException("certpath is null and index != -1"); |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
241 |
} |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
242 |
if (index < -1 || |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
243 |
(certPath != null && index >= certPath.getCertificates().size())) { |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
244 |
throw new InvalidObjectException("index out of range"); |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
245 |
} |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
246 |
} |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
247 |
|
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
248 |
/** |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
249 |
* The reason the validation algorithm failed. |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
250 |
* |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
251 |
* @since 1.7 |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
252 |
*/ |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
253 |
public static interface Reason extends java.io.Serializable { } |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
254 |
|
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
255 |
|
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
256 |
/** |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
257 |
* The BasicReason enumerates the potential reasons that a certification |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
258 |
* path of any type may be invalid. |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
259 |
* |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
260 |
* @since 1.7 |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
261 |
*/ |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
262 |
public static enum BasicReason implements Reason { |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
263 |
/** |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
264 |
* Unspecified reason. |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
265 |
*/ |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
266 |
UNSPECIFIED, |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
267 |
|
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
268 |
/** |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
269 |
* The certificate is expired. |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
270 |
*/ |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
271 |
EXPIRED, |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
272 |
|
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
273 |
/** |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
274 |
* The certificate is not yet valid. |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
275 |
*/ |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
276 |
NOT_YET_VALID, |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
277 |
|
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
278 |
/** |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
279 |
* The certificate is revoked. |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
280 |
*/ |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
281 |
REVOKED, |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
282 |
|
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
283 |
/** |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
284 |
* The revocation status of the certificate could not be determined. |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
285 |
*/ |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
286 |
UNDETERMINED_REVOCATION_STATUS, |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
287 |
|
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
288 |
/** |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
289 |
* The signature is invalid. |
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
290 |
*/ |
8163
d9bcc1208691
7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm
xuelei
parents:
5506
diff
changeset
|
291 |
INVALID_SIGNATURE, |
d9bcc1208691
7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm
xuelei
parents:
5506
diff
changeset
|
292 |
|
d9bcc1208691
7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm
xuelei
parents:
5506
diff
changeset
|
293 |
/** |
d9bcc1208691
7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm
xuelei
parents:
5506
diff
changeset
|
294 |
* The public key or the signature algorithm has been constrained. |
d9bcc1208691
7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm
xuelei
parents:
5506
diff
changeset
|
295 |
*/ |
d9bcc1208691
7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm
xuelei
parents:
5506
diff
changeset
|
296 |
ALGORITHM_CONSTRAINED |
1238
6d1f4b722acd
6465942: Add problem identification facility to the CertPathValidator framework
mullan
parents:
2
diff
changeset
|
297 |
} |
2 | 298 |
} |