< prev index next >

test/sun/security/mscapi/IsSunMSCAPIAvailable.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, 2007, 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.

@@ -31,20 +31,10 @@
 
 public class IsSunMSCAPIAvailable {
 
     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");
-            return;
-        }
-
         // Dynamically register the SunMSCAPI provider
         Security.addProvider(new sun.security.mscapi.SunMSCAPI());
 
 
         Provider p = Security.getProvider("SunMSCAPI");

@@ -56,11 +46,10 @@
         System.out.println("SunMSCAPI provider info is " + p.getInfo());
 
         /*
          * Secure Random
          */
-
         SecureRandom random = SecureRandom.getInstance("Windows-PRNG", p);
         System.out.println("    Windows-PRNG is implemented by: " +
             random.getClass().getName());
 
         /*
< prev index next >