author | coleenp |
Wed, 30 Aug 2017 19:18:22 -0400 | |
changeset 47098 | e704f55561c3 |
parent 41487 | aca4558a880d |
permissions | -rw-r--r-- |
2 | 1 |
/* |
29492
a4bf9a570035
8028266: Tidy warnings cleanup for packages java.security/javax.security
avstepan
parents:
28243
diff
changeset
|
2 |
* Copyright (c) 1998, 2015, 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; |
|
27 |
||
28 |
import java.io.*; |
|
29 |
import java.util.*; |
|
30 |
||
31 |
import java.security.KeyStore.*; |
|
32 |
import java.security.cert.Certificate; |
|
33 |
import java.security.cert.CertificateException; |
|
34 |
||
35 |
import javax.crypto.SecretKey; |
|
36 |
||
37 |
import javax.security.auth.callback.*; |
|
38 |
||
39 |
/** |
|
40 |
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>) |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
41 |
* for the {@code KeyStore} class. |
2 | 42 |
* All the abstract methods in this class must be implemented by each |
43 |
* cryptographic service provider who wishes to supply the implementation |
|
44 |
* of a keystore for a particular keystore type. |
|
45 |
* |
|
46 |
* @author Jan Luehe |
|
47 |
* |
|
48 |
* |
|
49 |
* @see KeyStore |
|
50 |
* |
|
51 |
* @since 1.2 |
|
52 |
*/ |
|
53 |
||
54 |
public abstract class KeyStoreSpi { |
|
55 |
||
56 |
/** |
|
57 |
* Returns the key associated with the given alias, using the given |
|
58 |
* password to recover it. The key must have been associated with |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
59 |
* the alias by a call to {@code setKeyEntry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
60 |
* or by a call to {@code setEntry} with a |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
61 |
* {@code PrivateKeyEntry} or {@code SecretKeyEntry}. |
2 | 62 |
* |
63 |
* @param alias the alias name |
|
64 |
* @param password the password for recovering the key |
|
65 |
* |
|
66 |
* @return the requested key, or null if the given alias does not exist |
|
67 |
* or does not identify a key-related entry. |
|
68 |
* |
|
69 |
* @exception NoSuchAlgorithmException if the algorithm for recovering the |
|
70 |
* key cannot be found |
|
71 |
* @exception UnrecoverableKeyException if the key cannot be recovered |
|
72 |
* (e.g., the given password is wrong). |
|
73 |
*/ |
|
74 |
public abstract Key engineGetKey(String alias, char[] password) |
|
75 |
throws NoSuchAlgorithmException, UnrecoverableKeyException; |
|
76 |
||
77 |
/** |
|
78 |
* Returns the certificate chain associated with the given alias. |
|
79 |
* The certificate chain must have been associated with the alias |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
80 |
* by a call to {@code setKeyEntry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
81 |
* or by a call to {@code setEntry} with a |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
82 |
* {@code PrivateKeyEntry}. |
2 | 83 |
* |
84 |
* @param alias the alias name |
|
85 |
* |
|
86 |
* @return the certificate chain (ordered with the user's certificate first |
|
87 |
* and the root certificate authority last), or null if the given alias |
|
88 |
* does not exist or does not contain a certificate chain |
|
89 |
*/ |
|
90 |
public abstract Certificate[] engineGetCertificateChain(String alias); |
|
91 |
||
92 |
/** |
|
93 |
* Returns the certificate associated with the given alias. |
|
94 |
* |
|
95 |
* <p> If the given alias name identifies an entry |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
96 |
* created by a call to {@code setCertificateEntry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
97 |
* or created by a call to {@code setEntry} with a |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
98 |
* {@code TrustedCertificateEntry}, |
2 | 99 |
* then the trusted certificate contained in that entry is returned. |
100 |
* |
|
101 |
* <p> If the given alias name identifies an entry |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
102 |
* created by a call to {@code setKeyEntry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
103 |
* or created by a call to {@code setEntry} with a |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
104 |
* {@code PrivateKeyEntry}, |
2 | 105 |
* then the first element of the certificate chain in that entry |
106 |
* (if a chain exists) is returned. |
|
107 |
* |
|
108 |
* @param alias the alias name |
|
109 |
* |
|
110 |
* @return the certificate, or null if the given alias does not exist or |
|
111 |
* does not contain a certificate. |
|
112 |
*/ |
|
113 |
public abstract Certificate engineGetCertificate(String alias); |
|
114 |
||
115 |
/** |
|
116 |
* Returns the creation date of the entry identified by the given alias. |
|
117 |
* |
|
118 |
* @param alias the alias name |
|
119 |
* |
|
120 |
* @return the creation date of this entry, or null if the given alias does |
|
121 |
* not exist |
|
122 |
*/ |
|
123 |
public abstract Date engineGetCreationDate(String alias); |
|
124 |
||
125 |
/** |
|
126 |
* Assigns the given key to the given alias, protecting it with the given |
|
127 |
* password. |
|
128 |
* |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
129 |
* <p>If the given key is of type {@code java.security.PrivateKey}, |
2 | 130 |
* it must be accompanied by a certificate chain certifying the |
131 |
* corresponding public key. |
|
132 |
* |
|
133 |
* <p>If the given alias already exists, the keystore information |
|
134 |
* associated with it is overridden by the given key (and possibly |
|
135 |
* certificate chain). |
|
136 |
* |
|
137 |
* @param alias the alias name |
|
138 |
* @param key the key to be associated with the alias |
|
139 |
* @param password the password to protect the key |
|
140 |
* @param chain the certificate chain for the corresponding public |
|
141 |
* key (only required if the given key is of type |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
142 |
* {@code java.security.PrivateKey}). |
2 | 143 |
* |
144 |
* @exception KeyStoreException if the given key cannot be protected, or |
|
145 |
* this operation fails for some other reason |
|
146 |
*/ |
|
147 |
public abstract void engineSetKeyEntry(String alias, Key key, |
|
148 |
char[] password, |
|
149 |
Certificate[] chain) |
|
150 |
throws KeyStoreException; |
|
151 |
||
152 |
/** |
|
153 |
* Assigns the given key (that has already been protected) to the given |
|
154 |
* alias. |
|
155 |
* |
|
156 |
* <p>If the protected key is of type |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
157 |
* {@code java.security.PrivateKey}, |
2 | 158 |
* it must be accompanied by a certificate chain certifying the |
159 |
* corresponding public key. |
|
160 |
* |
|
161 |
* <p>If the given alias already exists, the keystore information |
|
162 |
* associated with it is overridden by the given key (and possibly |
|
163 |
* certificate chain). |
|
164 |
* |
|
165 |
* @param alias the alias name |
|
166 |
* @param key the key (in protected format) to be associated with the alias |
|
167 |
* @param chain the certificate chain for the corresponding public |
|
168 |
* key (only useful if the protected key is of type |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
169 |
* {@code java.security.PrivateKey}). |
2 | 170 |
* |
171 |
* @exception KeyStoreException if this operation fails. |
|
172 |
*/ |
|
173 |
public abstract void engineSetKeyEntry(String alias, byte[] key, |
|
174 |
Certificate[] chain) |
|
175 |
throws KeyStoreException; |
|
176 |
||
177 |
/** |
|
178 |
* Assigns the given certificate to the given alias. |
|
179 |
* |
|
180 |
* <p> If the given alias identifies an existing entry |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
181 |
* created by a call to {@code setCertificateEntry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
182 |
* or created by a call to {@code setEntry} with a |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
183 |
* {@code TrustedCertificateEntry}, |
2 | 184 |
* the trusted certificate in the existing entry |
185 |
* is overridden by the given certificate. |
|
186 |
* |
|
187 |
* @param alias the alias name |
|
188 |
* @param cert the certificate |
|
189 |
* |
|
190 |
* @exception KeyStoreException if the given alias already exists and does |
|
191 |
* not identify an entry containing a trusted certificate, |
|
192 |
* or this operation fails for some other reason. |
|
193 |
*/ |
|
194 |
public abstract void engineSetCertificateEntry(String alias, |
|
195 |
Certificate cert) |
|
196 |
throws KeyStoreException; |
|
197 |
||
198 |
/** |
|
199 |
* Deletes the entry identified by the given alias from this keystore. |
|
200 |
* |
|
201 |
* @param alias the alias name |
|
202 |
* |
|
203 |
* @exception KeyStoreException if the entry cannot be removed. |
|
204 |
*/ |
|
205 |
public abstract void engineDeleteEntry(String alias) |
|
206 |
throws KeyStoreException; |
|
207 |
||
208 |
/** |
|
209 |
* Lists all the alias names of this keystore. |
|
210 |
* |
|
211 |
* @return enumeration of the alias names |
|
212 |
*/ |
|
213 |
public abstract Enumeration<String> engineAliases(); |
|
214 |
||
215 |
/** |
|
216 |
* Checks if the given alias exists in this keystore. |
|
217 |
* |
|
218 |
* @param alias the alias name |
|
219 |
* |
|
220 |
* @return true if the alias exists, false otherwise |
|
221 |
*/ |
|
222 |
public abstract boolean engineContainsAlias(String alias); |
|
223 |
||
224 |
/** |
|
225 |
* Retrieves the number of entries in this keystore. |
|
226 |
* |
|
227 |
* @return the number of entries in this keystore |
|
228 |
*/ |
|
229 |
public abstract int engineSize(); |
|
230 |
||
231 |
/** |
|
232 |
* Returns true if the entry identified by the given alias |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
233 |
* was created by a call to {@code setKeyEntry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
234 |
* or created by a call to {@code setEntry} with a |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
235 |
* {@code PrivateKeyEntry} or a {@code SecretKeyEntry}. |
2 | 236 |
* |
237 |
* @param alias the alias for the keystore entry to be checked |
|
238 |
* |
|
239 |
* @return true if the entry identified by the given alias is a |
|
240 |
* key-related, false otherwise. |
|
241 |
*/ |
|
242 |
public abstract boolean engineIsKeyEntry(String alias); |
|
243 |
||
244 |
/** |
|
245 |
* Returns true if the entry identified by the given alias |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
246 |
* was created by a call to {@code setCertificateEntry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
247 |
* or created by a call to {@code setEntry} with a |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
248 |
* {@code TrustedCertificateEntry}. |
2 | 249 |
* |
250 |
* @param alias the alias for the keystore entry to be checked |
|
251 |
* |
|
252 |
* @return true if the entry identified by the given alias contains a |
|
253 |
* trusted certificate, false otherwise. |
|
254 |
*/ |
|
255 |
public abstract boolean engineIsCertificateEntry(String alias); |
|
256 |
||
257 |
/** |
|
258 |
* Returns the (alias) name of the first keystore entry whose certificate |
|
259 |
* matches the given certificate. |
|
260 |
* |
|
261 |
* <p>This method attempts to match the given certificate with each |
|
262 |
* keystore entry. If the entry being considered was |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
263 |
* created by a call to {@code setCertificateEntry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
264 |
* or created by a call to {@code setEntry} with a |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
265 |
* {@code TrustedCertificateEntry}, |
2 | 266 |
* then the given certificate is compared to that entry's certificate. |
267 |
* |
|
268 |
* <p> If the entry being considered was |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
269 |
* created by a call to {@code setKeyEntry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
270 |
* or created by a call to {@code setEntry} with a |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
271 |
* {@code PrivateKeyEntry}, |
2 | 272 |
* then the given certificate is compared to the first |
273 |
* element of that entry's certificate chain. |
|
274 |
* |
|
275 |
* @param cert the certificate to match with. |
|
276 |
* |
|
277 |
* @return the alias name of the first entry with matching certificate, |
|
278 |
* or null if no such entry exists in this keystore. |
|
279 |
*/ |
|
280 |
public abstract String engineGetCertificateAlias(Certificate cert); |
|
281 |
||
282 |
/** |
|
283 |
* Stores this keystore to the given output stream, and protects its |
|
284 |
* integrity with the given password. |
|
285 |
* |
|
286 |
* @param stream the output stream to which this keystore is written. |
|
287 |
* @param password the password to generate the keystore integrity check |
|
288 |
* |
|
289 |
* @exception IOException if there was an I/O problem with data |
|
290 |
* @exception NoSuchAlgorithmException if the appropriate data integrity |
|
291 |
* algorithm could not be found |
|
292 |
* @exception CertificateException if any of the certificates included in |
|
293 |
* the keystore data could not be stored |
|
294 |
*/ |
|
295 |
public abstract void engineStore(OutputStream stream, char[] password) |
|
296 |
throws IOException, NoSuchAlgorithmException, CertificateException; |
|
297 |
||
298 |
/** |
|
299 |
* Stores this keystore using the given |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
300 |
* {@code KeyStore.LoadStoreParmeter}. |
2 | 301 |
* |
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
302 |
* @param param the {@code KeyStore.LoadStoreParmeter} |
2 | 303 |
* that specifies how to store the keystore, |
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
304 |
* which may be {@code null} |
2 | 305 |
* |
306 |
* @exception IllegalArgumentException if the given |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
307 |
* {@code KeyStore.LoadStoreParmeter} |
2 | 308 |
* input is not recognized |
309 |
* @exception IOException if there was an I/O problem with data |
|
310 |
* @exception NoSuchAlgorithmException if the appropriate data integrity |
|
311 |
* algorithm could not be found |
|
312 |
* @exception CertificateException if any of the certificates included in |
|
313 |
* the keystore data could not be stored |
|
314 |
* |
|
315 |
* @since 1.5 |
|
316 |
*/ |
|
317 |
public void engineStore(KeyStore.LoadStoreParameter param) |
|
318 |
throws IOException, NoSuchAlgorithmException, |
|
319 |
CertificateException { |
|
320 |
throw new UnsupportedOperationException(); |
|
321 |
} |
|
322 |
||
323 |
/** |
|
324 |
* Loads the keystore from the given input stream. |
|
325 |
* |
|
326 |
* <p>A password may be given to unlock the keystore |
|
327 |
* (e.g. the keystore resides on a hardware token device), |
|
328 |
* or to check the integrity of the keystore data. |
|
329 |
* If a password is not given for integrity checking, |
|
330 |
* then integrity checking is not performed. |
|
331 |
* |
|
332 |
* @param stream the input stream from which the keystore is loaded, |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
333 |
* or {@code null} |
2 | 334 |
* @param password the password used to check the integrity of |
335 |
* the keystore, the password used to unlock the keystore, |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
336 |
* or {@code null} |
2 | 337 |
* |
338 |
* @exception IOException if there is an I/O or format problem with the |
|
339 |
* keystore data, if a password is required but not given, |
|
340 |
* or if the given password was incorrect. If the error is due to a |
|
341 |
* wrong password, the {@link Throwable#getCause cause} of the |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
342 |
* {@code IOException} should be an |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
343 |
* {@code UnrecoverableKeyException} |
2 | 344 |
* @exception NoSuchAlgorithmException if the algorithm used to check |
345 |
* the integrity of the keystore cannot be found |
|
346 |
* @exception CertificateException if any of the certificates in the |
|
347 |
* keystore could not be loaded |
|
348 |
*/ |
|
349 |
public abstract void engineLoad(InputStream stream, char[] password) |
|
350 |
throws IOException, NoSuchAlgorithmException, CertificateException; |
|
351 |
||
352 |
/** |
|
353 |
* Loads the keystore using the given |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
354 |
* {@code KeyStore.LoadStoreParameter}. |
2 | 355 |
* |
356 |
* <p> Note that if this KeyStore has already been loaded, it is |
|
357 |
* reinitialized and loaded again from the given parameter. |
|
358 |
* |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
359 |
* @param param the {@code KeyStore.LoadStoreParameter} |
2 | 360 |
* that specifies how to load the keystore, |
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
361 |
* which may be {@code null} |
2 | 362 |
* |
32005
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
363 |
* @implSpec |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
364 |
* The default implementation examines {@code KeyStore.LoadStoreParameter} |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
365 |
* to extract its password and pass it to |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
366 |
* {@link KeyStoreSpi#engineLoad(InputStream, char[])} along with a |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
367 |
* {@code null} {@code InputStream}. |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
368 |
* <p> |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
369 |
* If {@code KeyStore.LoadStoreParameter} is {@code null} then |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
370 |
* the password parameter will also be {@code null}. |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
371 |
* Otherwise the {@code KeyStore.ProtectionParameter} of |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
372 |
* {@code KeyStore.LoadStoreParameter} must be either a |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
373 |
* {@code KeyStore.PasswordProtection} or a |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
374 |
* {@code KeyStore.CallbackHandlerProtection} that supports |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
375 |
* {@code PasswordCallback} so that the password parameter can be |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
376 |
* extracted. If the {@code KeyStore.ProtectionParameter} is neither |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
377 |
* of those classes then a {@code NoSuchAlgorithmException} is thrown. |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
378 |
* |
2 | 379 |
* @exception IllegalArgumentException if the given |
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
380 |
* {@code KeyStore.LoadStoreParameter} |
2 | 381 |
* input is not recognized |
382 |
* @exception IOException if there is an I/O or format problem with the |
|
383 |
* keystore data. If the error is due to an incorrect |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
384 |
* {@code ProtectionParameter} (e.g. wrong password) |
2 | 385 |
* the {@link Throwable#getCause cause} of the |
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
386 |
* {@code IOException} should be an |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
387 |
* {@code UnrecoverableKeyException} |
2 | 388 |
* @exception NoSuchAlgorithmException if the algorithm used to check |
389 |
* the integrity of the keystore cannot be found |
|
390 |
* @exception CertificateException if any of the certificates in the |
|
391 |
* keystore could not be loaded |
|
392 |
* |
|
393 |
* @since 1.5 |
|
394 |
*/ |
|
395 |
public void engineLoad(KeyStore.LoadStoreParameter param) |
|
396 |
throws IOException, NoSuchAlgorithmException, |
|
397 |
CertificateException { |
|
398 |
||
399 |
if (param == null) { |
|
400 |
engineLoad((InputStream)null, (char[])null); |
|
401 |
return; |
|
402 |
} |
|
403 |
||
32005
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
404 |
ProtectionParameter protection = param.getProtectionParameter(); |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
405 |
char[] password; |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
406 |
if (protection instanceof PasswordProtection) { |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
407 |
password = ((PasswordProtection)protection).getPassword(); |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
408 |
} else if (protection instanceof CallbackHandlerProtection) { |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
409 |
CallbackHandler handler = |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
410 |
((CallbackHandlerProtection)protection).getCallbackHandler(); |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
411 |
PasswordCallback callback = |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
412 |
new PasswordCallback("Password: ", false); |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
413 |
try { |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
414 |
handler.handle(new Callback[] {callback}); |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
415 |
} catch (UnsupportedCallbackException e) { |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
416 |
throw new NoSuchAlgorithmException |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
417 |
("Could not obtain password", e); |
2 | 418 |
} |
32005
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
419 |
password = callback.getPassword(); |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
420 |
callback.clearPassword(); |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
421 |
if (password == null) { |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
422 |
throw new NoSuchAlgorithmException("No password provided"); |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
423 |
} |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
424 |
} else { |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
425 |
throw new NoSuchAlgorithmException("ProtectionParameter must" |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
426 |
+ " be PasswordProtection or CallbackHandlerProtection"); |
2 | 427 |
} |
32005
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
428 |
engineLoad(null, password); |
2c716d9dac38
8130850: Support loading a keystore with a custom KeyStore.LoadStoreParameter class
vinnie
parents:
29492
diff
changeset
|
429 |
return; |
2 | 430 |
} |
431 |
||
432 |
/** |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
433 |
* Gets a {@code KeyStore.Entry} for the specified alias |
2 | 434 |
* with the specified protection parameter. |
435 |
* |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
436 |
* @param alias get the {@code KeyStore.Entry} for this alias |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
437 |
* @param protParam the {@code ProtectionParameter} |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
438 |
* used to protect the {@code Entry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
439 |
* which may be {@code null} |
2 | 440 |
* |
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
441 |
* @return the {@code KeyStore.Entry} for the specified alias, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
442 |
* or {@code null} if there is no such entry |
2 | 443 |
* |
444 |
* @exception KeyStoreException if the operation failed |
|
445 |
* @exception NoSuchAlgorithmException if the algorithm for recovering the |
|
446 |
* entry cannot be found |
|
447 |
* @exception UnrecoverableEntryException if the specified |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
448 |
* {@code protParam} were insufficient or invalid |
2 | 449 |
* @exception UnrecoverableKeyException if the entry is a |
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
450 |
* {@code PrivateKeyEntry} or {@code SecretKeyEntry} |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
451 |
* and the specified {@code protParam} does not contain |
2 | 452 |
* the information needed to recover the key (e.g. wrong password) |
453 |
* |
|
454 |
* @since 1.5 |
|
455 |
*/ |
|
456 |
public KeyStore.Entry engineGetEntry(String alias, |
|
457 |
KeyStore.ProtectionParameter protParam) |
|
458 |
throws KeyStoreException, NoSuchAlgorithmException, |
|
459 |
UnrecoverableEntryException { |
|
460 |
||
461 |
if (!engineContainsAlias(alias)) { |
|
462 |
return null; |
|
463 |
} |
|
464 |
||
465 |
if (protParam == null) { |
|
466 |
if (engineIsCertificateEntry(alias)) { |
|
467 |
return new KeyStore.TrustedCertificateEntry |
|
468 |
(engineGetCertificate(alias)); |
|
469 |
} else { |
|
470 |
throw new UnrecoverableKeyException |
|
471 |
("requested entry requires a password"); |
|
472 |
} |
|
473 |
} |
|
474 |
||
475 |
if (protParam instanceof KeyStore.PasswordProtection) { |
|
476 |
if (engineIsCertificateEntry(alias)) { |
|
477 |
throw new UnsupportedOperationException |
|
478 |
("trusted certificate entries are not password-protected"); |
|
479 |
} else if (engineIsKeyEntry(alias)) { |
|
480 |
KeyStore.PasswordProtection pp = |
|
481 |
(KeyStore.PasswordProtection)protParam; |
|
41487
aca4558a880d
8167371: KeyStoreSpi.engineSetEntry should throw an Exception if password protection alg is specified
vinnie
parents:
32231
diff
changeset
|
482 |
if (pp.getProtectionAlgorithm() != null) { |
aca4558a880d
8167371: KeyStoreSpi.engineSetEntry should throw an Exception if password protection alg is specified
vinnie
parents:
32231
diff
changeset
|
483 |
throw new KeyStoreException( |
aca4558a880d
8167371: KeyStoreSpi.engineSetEntry should throw an Exception if password protection alg is specified
vinnie
parents:
32231
diff
changeset
|
484 |
"unsupported password protection algorithm"); |
aca4558a880d
8167371: KeyStoreSpi.engineSetEntry should throw an Exception if password protection alg is specified
vinnie
parents:
32231
diff
changeset
|
485 |
} |
2 | 486 |
char[] password = pp.getPassword(); |
487 |
||
488 |
Key key = engineGetKey(alias, password); |
|
489 |
if (key instanceof PrivateKey) { |
|
490 |
Certificate[] chain = engineGetCertificateChain(alias); |
|
491 |
return new KeyStore.PrivateKeyEntry((PrivateKey)key, chain); |
|
492 |
} else if (key instanceof SecretKey) { |
|
493 |
return new KeyStore.SecretKeyEntry((SecretKey)key); |
|
494 |
} |
|
495 |
} |
|
496 |
} |
|
497 |
||
498 |
throw new UnsupportedOperationException(); |
|
499 |
} |
|
500 |
||
501 |
/** |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
502 |
* Saves a {@code KeyStore.Entry} under the specified alias. |
2 | 503 |
* The specified protection parameter is used to protect the |
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
504 |
* {@code Entry}. |
2 | 505 |
* |
506 |
* <p> If an entry already exists for the specified alias, |
|
507 |
* it is overridden. |
|
508 |
* |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
509 |
* @param alias save the {@code KeyStore.Entry} under this alias |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
510 |
* @param entry the {@code Entry} to save |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
511 |
* @param protParam the {@code ProtectionParameter} |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
512 |
* used to protect the {@code Entry}, |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
513 |
* which may be {@code null} |
2 | 514 |
* |
515 |
* @exception KeyStoreException if this operation fails |
|
516 |
* |
|
517 |
* @since 1.5 |
|
518 |
*/ |
|
519 |
public void engineSetEntry(String alias, KeyStore.Entry entry, |
|
520 |
KeyStore.ProtectionParameter protParam) |
|
521 |
throws KeyStoreException { |
|
522 |
||
523 |
// get password |
|
524 |
if (protParam != null && |
|
525 |
!(protParam instanceof KeyStore.PasswordProtection)) { |
|
526 |
throw new KeyStoreException("unsupported protection parameter"); |
|
527 |
} |
|
528 |
KeyStore.PasswordProtection pProtect = null; |
|
529 |
if (protParam != null) { |
|
530 |
pProtect = (KeyStore.PasswordProtection)protParam; |
|
41487
aca4558a880d
8167371: KeyStoreSpi.engineSetEntry should throw an Exception if password protection alg is specified
vinnie
parents:
32231
diff
changeset
|
531 |
if (pProtect.getProtectionAlgorithm() != null) { |
aca4558a880d
8167371: KeyStoreSpi.engineSetEntry should throw an Exception if password protection alg is specified
vinnie
parents:
32231
diff
changeset
|
532 |
throw new KeyStoreException( |
aca4558a880d
8167371: KeyStoreSpi.engineSetEntry should throw an Exception if password protection alg is specified
vinnie
parents:
32231
diff
changeset
|
533 |
"unsupported password protection algorithm"); |
aca4558a880d
8167371: KeyStoreSpi.engineSetEntry should throw an Exception if password protection alg is specified
vinnie
parents:
32231
diff
changeset
|
534 |
} |
2 | 535 |
} |
536 |
||
537 |
// set entry |
|
538 |
if (entry instanceof KeyStore.TrustedCertificateEntry) { |
|
539 |
if (protParam != null && pProtect.getPassword() != null) { |
|
540 |
// pre-1.5 style setCertificateEntry did not allow password |
|
541 |
throw new KeyStoreException |
|
542 |
("trusted certificate entries are not password-protected"); |
|
543 |
} else { |
|
544 |
KeyStore.TrustedCertificateEntry tce = |
|
545 |
(KeyStore.TrustedCertificateEntry)entry; |
|
546 |
engineSetCertificateEntry(alias, tce.getTrustedCertificate()); |
|
547 |
return; |
|
548 |
} |
|
549 |
} else if (entry instanceof KeyStore.PrivateKeyEntry) { |
|
550 |
if (pProtect == null || pProtect.getPassword() == null) { |
|
551 |
// pre-1.5 style setKeyEntry required password |
|
552 |
throw new KeyStoreException |
|
553 |
("non-null password required to create PrivateKeyEntry"); |
|
554 |
} else { |
|
555 |
engineSetKeyEntry |
|
556 |
(alias, |
|
557 |
((KeyStore.PrivateKeyEntry)entry).getPrivateKey(), |
|
558 |
pProtect.getPassword(), |
|
559 |
((KeyStore.PrivateKeyEntry)entry).getCertificateChain()); |
|
560 |
return; |
|
561 |
} |
|
562 |
} else if (entry instanceof KeyStore.SecretKeyEntry) { |
|
563 |
if (pProtect == null || pProtect.getPassword() == null) { |
|
564 |
// pre-1.5 style setKeyEntry required password |
|
565 |
throw new KeyStoreException |
|
566 |
("non-null password required to create SecretKeyEntry"); |
|
567 |
} else { |
|
568 |
engineSetKeyEntry |
|
569 |
(alias, |
|
570 |
((KeyStore.SecretKeyEntry)entry).getSecretKey(), |
|
571 |
pProtect.getPassword(), |
|
572 |
(Certificate[])null); |
|
573 |
return; |
|
574 |
} |
|
575 |
} |
|
576 |
||
577 |
throw new KeyStoreException |
|
578 |
("unsupported entry type: " + entry.getClass().getName()); |
|
579 |
} |
|
580 |
||
581 |
/** |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
582 |
* Determines if the keystore {@code Entry} for the specified |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
583 |
* {@code alias} is an instance or subclass of the specified |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
584 |
* {@code entryClass}. |
2 | 585 |
* |
586 |
* @param alias the alias name |
|
587 |
* @param entryClass the entry class |
|
588 |
* |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
589 |
* @return true if the keystore {@code Entry} for the specified |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
590 |
* {@code alias} is an instance or subclass of the |
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
591 |
* specified {@code entryClass}, false otherwise |
2 | 592 |
* |
593 |
* @since 1.5 |
|
594 |
*/ |
|
595 |
public boolean |
|
596 |
engineEntryInstanceOf(String alias, |
|
597 |
Class<? extends KeyStore.Entry> entryClass) |
|
598 |
{ |
|
599 |
if (entryClass == KeyStore.TrustedCertificateEntry.class) { |
|
600 |
return engineIsCertificateEntry(alias); |
|
601 |
} |
|
602 |
if (entryClass == KeyStore.PrivateKeyEntry.class) { |
|
603 |
return engineIsKeyEntry(alias) && |
|
604 |
engineGetCertificate(alias) != null; |
|
605 |
} |
|
606 |
if (entryClass == KeyStore.SecretKeyEntry.class) { |
|
607 |
return engineIsKeyEntry(alias) && |
|
608 |
engineGetCertificate(alias) == null; |
|
609 |
} |
|
610 |
return false; |
|
611 |
} |
|
28243
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
612 |
|
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
613 |
/** |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
614 |
* Probes the specified input stream to determine whether it contains a |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
615 |
* keystore that is supported by this implementation, or not. |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
616 |
* |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
617 |
* @implSpec |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
618 |
* This method returns false by default. Keystore implementations should |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
619 |
* override this method to peek at the data stream directly or to use other |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
620 |
* content detection mechanisms. |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
621 |
* |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
622 |
* @param stream the keystore data to be probed |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
623 |
* |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
624 |
* @return true if the keystore data is supported, otherwise false |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
625 |
* |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
626 |
* @throws IOException if there is an I/O problem with the keystore data. |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
627 |
* @throws NullPointerException if stream is {@code null}. |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
628 |
* |
32231
202718e81db8
8130799: KeyStoreSpi.engineProbe does not throw the expected NullPointerException
vinnie
parents:
32005
diff
changeset
|
629 |
* @since 9 |
28243
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
630 |
*/ |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
631 |
public boolean engineProbe(InputStream stream) throws IOException { |
32231
202718e81db8
8130799: KeyStoreSpi.engineProbe does not throw the expected NullPointerException
vinnie
parents:
32005
diff
changeset
|
632 |
if (stream == null) { |
202718e81db8
8130799: KeyStoreSpi.engineProbe does not throw the expected NullPointerException
vinnie
parents:
32005
diff
changeset
|
633 |
throw new NullPointerException("input stream must not be null"); |
202718e81db8
8130799: KeyStoreSpi.engineProbe does not throw the expected NullPointerException
vinnie
parents:
32005
diff
changeset
|
634 |
} |
28243
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
635 |
return false; |
47080f9ae750
8044445: JEP 229: Create PKCS12 Keystores by Default
vinnie
parents:
25859
diff
changeset
|
636 |
} |
2 | 637 |
} |