< prev index next >

test/sun/security/mscapi/AccessKeyStore.java

Print this page
rev 11258 : 8139436: sun.security.mscapi.KeyStore might load incomplete data
Reviewed-by: vinnie, weijun

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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.

@@ -34,21 +34,10 @@
 
 public class AccessKeyStore {
 
     public static void main(String[] args) throws Exception {
 
-        // Check if the provider is available
-        try {
-            Class.forName("sun.security.mscapi.SunMSCAPI");
-
-        } catch (Exception e) {
-            System.out.println(
-                "The SunMSCAPI provider is not available on this platform: " +
-                e);
-            return;
-        }
-
         // Check that a security manager has been installed
         if (System.getSecurityManager() == null) {
             throw new Exception("A security manager has not been installed");
         }
 

@@ -84,12 +73,12 @@
                 throw se;
             }
         }
 
         int i = 0;
-        for (Enumeration e = keyStore.aliases(); e.hasMoreElements(); ) {
-            String alias = (String) e.nextElement();
+        for (Enumeration<String> e = keyStore.aliases(); e.hasMoreElements(); ) {
+            String alias = e.nextElement();
             displayEntry(keyStore, alias, i++);
         }
     }
 
     private static void displayEntry(KeyStore keyStore, String alias,
< prev index next >