< prev index next >

src/java.base/share/classes/sun/security/tools/keytool/Main.java

Print this page

        

*** 82,92 **** import sun.security.provider.X509Factory; import sun.security.provider.certpath.ssl.SSLServerCertStore; import sun.security.util.Password; import sun.security.util.SecurityProperties; import sun.security.util.SecurityProviderConstants; - import sun.security.util.SignatureUtil; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; --- 82,91 ----
*** 1440,1455 **** (PrivateKey)recoverKey(alias, storePass, keyPass).fst; if (sigAlgName == null) { sigAlgName = getCompatibleSigAlgName(privateKey); } Signature signature = Signature.getInstance(sigAlgName); ! AlgorithmParameterSpec params = AlgorithmId ! .getDefaultAlgorithmParameterSpec(sigAlgName, privateKey); ! ! SignatureUtil.initSignWithParam(signature, privateKey, params, null); X509CertInfo info = new X509CertInfo(); AlgorithmId algID = AlgorithmId.getWithParameterSpec(sigAlgName, params); info.set(X509CertInfo.VALIDITY, interval); info.set(X509CertInfo.SERIAL_NUMBER, CertificateSerialNumber.newRandom64bit(new SecureRandom())); info.set(X509CertInfo.VERSION, --- 1439,1453 ---- (PrivateKey)recoverKey(alias, storePass, keyPass).fst; if (sigAlgName == null) { sigAlgName = getCompatibleSigAlgName(privateKey); } Signature signature = Signature.getInstance(sigAlgName); ! signature.initSign(privateKey); X509CertInfo info = new X509CertInfo(); + AlgorithmParameterSpec params = AlgorithmId + .getDefaultAlgorithmParameterSpec(sigAlgName, privateKey); AlgorithmId algID = AlgorithmId.getWithParameterSpec(sigAlgName, params); info.set(X509CertInfo.VALIDITY, interval); info.set(X509CertInfo.SERIAL_NUMBER, CertificateSerialNumber.newRandom64bit(new SecureRandom())); info.set(X509CertInfo.VERSION,
*** 1599,1611 **** if (sigAlgName == null) { sigAlgName = getCompatibleSigAlgName(privKey); } Signature signature = Signature.getInstance(sigAlgName); AlgorithmParameterSpec params = AlgorithmId .getDefaultAlgorithmParameterSpec(sigAlgName, privKey); ! SignatureUtil.initSignWithParam(signature, privKey, params, null); X500Name subject = dname == null? new X500Name(((X509Certificate)cert).getSubjectDN().toString()): new X500Name(dname); --- 1597,1612 ---- if (sigAlgName == null) { sigAlgName = getCompatibleSigAlgName(privKey); } Signature signature = Signature.getInstance(sigAlgName); + signature.initSign(privKey); AlgorithmParameterSpec params = AlgorithmId .getDefaultAlgorithmParameterSpec(sigAlgName, privKey); ! if (params != null) { ! signature.setParameter(params); ! } X500Name subject = dname == null? new X500Name(((X509Certificate)cert).getSubjectDN().toString()): new X500Name(dname);
*** 3576,3590 **** char[] keyPass) throws Exception { Key key = null; - if (KeyStoreUtil.isWindowsKeyStore(storetype)) { - key = keyStore.getKey(alias, null); - return Pair.of(key, null); - } - if (keyStore.containsAlias(alias) == false) { MessageFormat form = new MessageFormat (rb.getString("Alias.alias.does.not.exist")); Object[] source = {alias}; throw new Exception(form.format(source)); --- 3577,3586 ----
< prev index next >