8006946: PKCS12 test failure due to incorrect alias name
authorvinnie
Fri, 25 Jan 2013 16:19:39 +0000
changeset 15307 6c19bd915338
parent 15306 4d1877e73daa
child 15308 55742a890b6c
8006946: PKCS12 test failure due to incorrect alias name Reviewed-by: mullan
jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
--- a/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Fri Jan 25 13:09:47 2013 +0000
+++ b/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Fri Jan 25 16:19:39 2013 +0000
@@ -2224,11 +2224,11 @@
                         keyId = "01".getBytes("UTF8");
                     }
                 }
-                if (alias == null) {
-                    alias = getUnfriendlyName();
-                }
                 // Trusted certificate
                 if (trustedKeyUsage != null) {
+                    if (alias == null) {
+                        alias = getUnfriendlyName();
+                    }
                     CertEntry certEntry =
                         new CertEntry(cert, keyId, alias, trustedKeyUsage,
                             attributes);