jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java
changeset 31270 e6470b24700d
parent 30506 1998a5644f50
child 31426 9cd672654f97
equal deleted inserted replaced
31269:14968253ce7e 31270:e6470b24700d
   726                     provClass = cl.loadClass(provName);
   726                     provClass = cl.loadClass(provName);
   727                 } else {
   727                 } else {
   728                     provClass = Class.forName(provName);
   728                     provClass = Class.forName(provName);
   729                 }
   729                 }
   730 
   730 
   731                 String provArg = provider.snd;
   731                 Object obj = provClass.newInstance();
   732                 Object obj;
       
   733                 if (provArg == null) {
       
   734                     obj = provClass.newInstance();
       
   735                 } else {
       
   736                     Constructor<?> c = provClass.getConstructor(PARAM_STRING);
       
   737                     obj = c.newInstance(provArg);
       
   738                 }
       
   739                 if (!(obj instanceof Provider)) {
   732                 if (!(obj instanceof Provider)) {
   740                     MessageFormat form = new MessageFormat
   733                     MessageFormat form = new MessageFormat
   741                         (rb.getString("provName.not.a.provider"));
   734                         (rb.getString("provName.not.a.provider"));
   742                     Object[] source = {provName};
   735                     Object[] source = {provName};
   743                     throw new Exception(form.format(source));
   736                     throw new Exception(form.format(source));
   744                 }
   737                 }
   745                 Security.addProvider((Provider)obj);
   738                 Provider p = (Provider) obj;
       
   739                 String provArg = provider.snd;
       
   740                 if (provArg != null) {
       
   741                     p = p.configure(provArg);
       
   742                 }
       
   743                 Security.addProvider(p);
   746             }
   744             }
   747         }
   745         }
   748 
   746 
   749         if (command == LIST && verbose && rfc) {
   747         if (command == LIST && verbose && rfc) {
   750             System.err.println(rb.getString
   748             System.err.println(rb.getString