< prev index next >

src/java.base/share/classes/sun/security/pkcs10/PKCS10.java

Print this page

        

@@ -165,12 +165,16 @@
         // key and signature algorithm we found.
         //
         try {
             sigAlg = id.getName();
             sig = Signature.getInstance(sigAlg);
-            SignatureUtil.initVerifyWithParam(sig, subjectPublicKeyInfo,
-                SignatureUtil.getParamSpec(sigAlg, id.getParameters()));
+
+            sig.initVerify(subjectPublicKeyInfo);
+
+            // set parameters after Signature.initSign/initVerify call,
+            // so the deferred provider selections occur when key is set
+            SignatureUtil.specialSetParameter(sig, id.getParameters());
 
             sig.update(data);
             if (!sig.verify(sigData)) {
                 throw new SignatureException("Invalid PKCS #10 signature");
             }
< prev index next >