< prev index next >

src/windows/classes/sun/security/mscapi/KeyStore.java

Print this page
rev 13649 : 8218553: Enhance keystore load debug output
Reviewed-by: weijun

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -43,10 +43,12 @@
 import java.security.interfaces.RSAPrivateCrtKey;
 import java.util.*;
 
 import sun.security.action.GetPropertyAction;
 
+import sun.security.util.Debug;
+
 /**
  * Implementation of key store for Windows using the Microsoft Crypto API.
  *
  * @since 1.6
  */

@@ -184,10 +186,11 @@
      * The mode is enabled by default.
      */
     private static final String KEYSTORE_COMPATIBILITY_MODE_PROP =
         "sun.security.mscapi.keyStoreCompatibilityMode";
     private final boolean keyStoreCompatibilityMode;
+    private static final Debug debug = Debug.getInstance("keystore");
 
     /*
      * The keystore entries.
      * Keys in the map are unique aliases (thus can differ from
      * KeyEntry.getAlias())

@@ -726,10 +729,15 @@
             loadKeysOrCertificateChains(getName());
 
         } catch (KeyStoreException e) {
             throw new IOException(e);
         }
+
+        if (debug != null) {
+            debug.println("MSCAPI keystore load: entry count: " +
+                    entries.size());
+        }
     }
 
     /**
      * Stores the given entry into the map, making sure
      * the alias, used as the key is unique.
< prev index next >