6709758: keytool default cert fingerprint algorithm should be SHA1, not MD5
authorweijun
Sun, 27 Jul 2008 19:16:15 +0800
changeset 909 c7bb1699d1b0
parent 908 72d0a60834cf
child 910 1f53246fb014
6709758: keytool default cert fingerprint algorithm should be SHA1, not MD5 Reviewed-by: mullan, xuelei
jdk/src/share/classes/sun/security/tools/KeyTool.java
jdk/src/share/classes/sun/security/util/Resources.java
--- a/jdk/src/share/classes/sun/security/tools/KeyTool.java	Wed Jul 23 12:16:28 2008 -0700
+++ b/jdk/src/share/classes/sun/security/tools/KeyTool.java	Sun Jul 27 19:16:15 2008 +0800
@@ -1454,8 +1454,8 @@
                 } else {
                     // Print the digest of the user cert only
                     out.println
-                        (rb.getString("Certificate fingerprint (MD5): ") +
-                        getCertFingerPrint("MD5", chain[0]));
+                        (rb.getString("Certificate fingerprint (SHA1): ") +
+                        getCertFingerPrint("SHA1", chain[0]));
                 }
             }
         } else if (keyStore.entryInstanceOf(alias,
@@ -1472,8 +1472,8 @@
                 out.println(cert.toString());
             } else {
                 out.println(rb.getString("trustedCertEntry,"));
-                out.println(rb.getString("Certificate fingerprint (MD5): ")
-                            + getCertFingerPrint("MD5", cert));
+                out.println(rb.getString("Certificate fingerprint (SHA1): ")
+                            + getCertFingerPrint("SHA1", cert));
             }
         } else {
             out.println(rb.getString("Unknown Entry Type"));
--- a/jdk/src/share/classes/sun/security/util/Resources.java	Wed Jul 23 12:16:28 2008 -0700
+++ b/jdk/src/share/classes/sun/security/util/Resources.java	Sun Jul 27 19:16:15 2008 +0800
@@ -171,7 +171,7 @@
         {"Entry type: <type>", "Entry type: {0}"},
         {"Certificate chain length: ", "Certificate chain length: "},
         {"Certificate[(i + 1)]:", "Certificate[{0,number,integer}]:"},
-        {"Certificate fingerprint (MD5): ", "Certificate fingerprint (MD5): "},
+        {"Certificate fingerprint (SHA1): ", "Certificate fingerprint (SHA1): "},
         {"Entry type: trustedCertEntry\n", "Entry type: trustedCertEntry\n"},
         {"trustedCertEntry,", "trustedCertEntry,"},
         {"Keystore type: ", "Keystore type: "},