< prev index next >

test/sun/security/mscapi/SignUsingSHA2withRSA.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) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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.

@@ -56,16 +56,16 @@
 
         KeyStore ks = KeyStore.getInstance("Windows-MY", "SunMSCAPI");
         ks.load(null, null);
         System.out.println("Loaded keystore: Windows-MY");
 
-        Enumeration e = ks.aliases();
+        Enumeration<String> e = ks.aliases();
         PrivateKey privateKey = null;
         PublicKey publicKey = null;
 
         while (e.hasMoreElements()) {
-            String alias = (String) e.nextElement();
+            String alias = e.nextElement();
             if (alias.equals("6753664")) {
                 System.out.println("Loaded entry: " + alias);
                 privateKey = (PrivateKey) ks.getKey(alias, null);
                 publicKey = (PublicKey) ks.getCertificate(alias).getPublicKey();
             }
< prev index next >