test/sun/security/pkcs11/rsa/TestCACerts.java

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

@@ -25,10 +25,11 @@
  * @test
  * @bug 4856966
  * @summary Test the new RSA provider can verify all the RSA certs in the cacerts file
  * @author Andreas Sterbenz
  * @library ..
+ * @library ../../../../java/security/testlibrary
  */
 
 // this test serves as our known answer test
 
 import java.io.*;

@@ -45,11 +46,11 @@
         main(new TestCACerts());
     }
 
     public void main(Provider p) throws Exception {
         long start = System.currentTimeMillis();
-        Security.addProvider(p);
+        Providers.setAt(p, 1);
         try {
             String PROVIDER = p.getName();
             String javaHome = System.getProperty("java.home");
             String caCerts = javaHome + SEP + "lib" + SEP + "security" + SEP + "cacerts";
             InputStream in = new FileInputStream(caCerts);