test/tools/launcher/MiscTests.java

Print this page
7191662: JCE providers should be located via ServiceLoader

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

@@ -41,11 +41,12 @@
         if (is64Bit && isWindows) {
             return;
         }
         StringBuilder sb = new StringBuilder();
         sb.append("public static void main(String... args) {\n");
-        sb.append("java.security.Provider p = new sun.security.pkcs11.SunPKCS11(args[0]);\n");
+        sb.append("java.security.Provider p = new sun.security.pkcs11.SunPKCS11();\n");
+        sb.append("p = p.configure(args[0]);\n");
         sb.append("java.security.Security.insertProviderAt(p, 1);\n");
         sb.append("}");
         File testJar = new File("Foo.jar");
         testJar.delete();
         try {