equal
deleted
inserted
replaced
31 import java.io.OutputStream; |
31 import java.io.OutputStream; |
32 import java.security.AccessController; |
32 import java.security.AccessController; |
33 import java.security.InvalidKeyException; |
33 import java.security.InvalidKeyException; |
34 import java.security.KeyStoreSpi; |
34 import java.security.KeyStoreSpi; |
35 import java.security.KeyStoreException; |
35 import java.security.KeyStoreException; |
|
36 import java.security.PrivilegedAction; |
36 import java.security.UnrecoverableKeyException; |
37 import java.security.UnrecoverableKeyException; |
37 import java.security.NoSuchAlgorithmException; |
38 import java.security.NoSuchAlgorithmException; |
38 import java.security.SecurityPermission; |
39 import java.security.SecurityPermission; |
39 import java.security.cert.X509Certificate; |
40 import java.security.cert.X509Certificate; |
40 import java.security.cert.Certificate; |
41 import java.security.cert.Certificate; |
46 import java.util.Date; |
47 import java.util.Date; |
47 import java.util.Enumeration; |
48 import java.util.Enumeration; |
48 import java.util.Iterator; |
49 import java.util.Iterator; |
49 import java.util.UUID; |
50 import java.util.UUID; |
50 |
51 |
51 import sun.security.action.GetPropertyAction; |
|
52 |
|
53 /** |
52 /** |
54 * Implementation of key store for Windows using the Microsoft Crypto API. |
53 * Implementation of key store for Windows using the Microsoft Crypto API. |
55 * |
54 * |
56 * @since 1.6 |
55 * @since 1.6 |
57 */ |
56 */ |
203 */ |
202 */ |
204 private final String storeName; |
203 private final String storeName; |
205 |
204 |
206 KeyStore(String storeName) { |
205 KeyStore(String storeName) { |
207 // Get the compatibility mode |
206 // Get the compatibility mode |
208 String prop = |
207 String prop = AccessController.doPrivileged( |
209 AccessController.doPrivileged( |
208 (PrivilegedAction<String>) () -> System.getProperty(KEYSTORE_COMPATIBILITY_MODE_PROP)); |
210 new GetPropertyAction(KEYSTORE_COMPATIBILITY_MODE_PROP)); |
|
211 |
209 |
212 if ("false".equalsIgnoreCase(prop)) { |
210 if ("false".equalsIgnoreCase(prop)) { |
213 keyStoreCompatibilityMode = false; |
211 keyStoreCompatibilityMode = false; |
214 } else { |
212 } else { |
215 keyStoreCompatibilityMode = true; |
213 keyStoreCompatibilityMode = true; |